Skip to content

Commit ae646b6

Browse files
authored
Pin pytest <9.2 for python >=3.10 to fix pytest-benchmark 4.x breakage (#878)
pytest 9.2.0 removed the private Node._nodeid attribute, which pytest_benchmark/fixture.py (BenchmarkFixture.__init__) relies on, causing every benchmark-fixture test to fail with AttributeError. pytest-benchmark 5.x would fix this but requires Python >=3.9, and this repo still supports 3.8, so cap pytest at <9.2 on the 9.x line instead (3.8/3.9 already use pytest ^8.3.4, which is unaffected). TODO: remove the cap once pytest-benchmark ships a fix compatible with both pytest 9.2+ and Python 3.8, or once 3.8 support is dropped.
1 parent 5b86bdd commit ae646b6

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

‎poetry.lock‎

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎pyproject.toml‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,9 @@ requests = [
4848
]
4949
pytest = [
5050
{ version = "^8.3.4", optional = true, python = ">=3.8,<3.10" },
51-
{ version = "^9.0.3", optional = true, python = ">=3.10" },
51+
# TODO: Remove the <9.2 cap once pytest-benchmark 4.x is compatible with pytest 9.2+
52+
# (pytest 9.2 removed Node._nodeid, which pytest_benchmark/fixture.py relies on).
53+
{ version = ">=9.0.3,<9.2", optional = true, python = ">=3.10" },
5254
]
5355
pytest-benchmark = { version = "^4.0", optional = true }
5456
flake8 = { version = "^5.0.4", optional = true }

0 commit comments

Comments
 (0)