From 0eb22cebf98f4581d4ef50c3c49c7cd5694e0385 Mon Sep 17 00:00:00 2001 From: Federico Mon Date: Wed, 28 Oct 2026 09:59:30 +0100 Subject: [PATCH] Pin pytest <9.2 for python >=3.10 to fix pytest-benchmark 4.x breakage 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. --- poetry.lock | 2 +- pyproject.toml | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/poetry.lock b/poetry.lock index bf6c6fec4..94b94d1ed 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1149,4 +1149,4 @@ dev = ["botocore", "flake8", "pytest", "pytest", "pytest-benchmark", "requests", [metadata] lock-version = "2.1" python-versions = ">=3.8.0,<3.15" -content-hash = "3da1bc2540691200481913d90171aa3a6a3700cb32059b9462dfd64f9f51d092" +content-hash = "6b92c24d6653f8f74df7d8d3e31aed3906e906e183a98a8f81f8721da78b1841" diff --git a/pyproject.toml b/pyproject.toml index c97c134ab..184541252 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -48,7 +48,9 @@ requests = [ ] pytest = [ { version = "^8.3.4", optional = true, python = ">=3.8,<3.10" }, - { version = "^9.0.3", optional = true, python = ">=3.10" }, + # TODO: Remove the <9.2 cap once pytest-benchmark 4.x is compatible with pytest 9.2+ + # (pytest 9.2 removed Node._nodeid, which pytest_benchmark/fixture.py relies on). + { version = ">=9.0.3,<9.2", optional = true, python = ">=3.10" }, ] pytest-benchmark = { version = "^4.0", optional = true } flake8 = { version = "^5.0.4", optional = true }