Repository navigation
Pin pytest <9.2 to fix CI breakage with pytest-benchmark 4.x - #878
Merged
Merged
Conversation
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.
gnufede
marked this pull request as ready for review
October 28, 2026 09:03
There was a problem hiding this comment.
More details
The pytest upper bound excludes 9.2+ while preserving the existing Python-version split and compatible locked versions. The updated lockfile passes Poetry’s consistency check.
🤖 Bits Code Review · Commit 0eb22ce
pablomartinezbernardo
approved these changes
Oct 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Caps
pytestat<9.2for Python >= 3.10 inpyproject.tomland regeneratespoetry.lock(content-hash only).pytest 9.2.0 removed the private
Node._nodeidattribute, whichpytest_benchmark/fixture.py(BenchmarkFixture.__init__) relies on. As a result, every test using thebenchmarkfixture fails with:CI installs dev dependencies with
pip install .[dev](.github/workflows/build.ymlandtests/Dockerfile), so the previous^9.0.3constraint picked up the newly released pytest 9.2.0 and broke the build.Motivation
CI broke with the release of pytest 9.2.0 (incompatibility with pytest-benchmark 4.x, the version range this repo pins).
Why cap pytest instead of upgrading pytest-benchmark:
^8.3.4).Testing Guidelines
pip install .[dev]now resolves to pytest 9.1.1 + pytest-benchmark 4.0.0.pytest tests/test_benchmarks.pyon Python 3.13 with those versions: 217 passed (including the previously failingtest_trigger_extract_trigger_tags[sqs-batch]).poetry checkpasses;poetry.lockregenerated with Poetry 2.2.1 (only the content-hash changed, pytest stays at 9.0.3).Additional Notes
Upstream tracking issue (still open): ionelmc/pytest-benchmark#321
The
<9.2cap can be removed once pytest-benchmark ships a release compatible with both pytest 9.2+ and Python 3.8, or once Python 3.8 support is dropped.Types of Changes
Check all that apply