Repository navigation
fix: avoid deprecated nodeid argument to _register_fixture - #827
Merged
youtux merged 8 commits intoSep 14, 2026
Merged
Conversation
Injecting a step's target_fixture called FixtureManager._register_fixture(nodeid=...). pytest 9.1 deprecated the nodeid argument in favour of node, so every scenario using a target_fixture emitted PytestRemovedIn10Warning, and suites that turn deprecation warnings into errors failed at collection. Pass node=request.node on pytest >= 9.1 and keep nodeid on older versions, matching the existing version-branching in compat.py. Added a regression test asserting the injection scenario runs clean under -W error::DeprecationWarning; it fails without this change.
youtux
previously approved these changes
Aug 5, 2026
youtux
enabled auto-merge
August 5, 2026 21:16
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #827 +/- ##
==========================================
+ Coverage 96.12% 96.13% +0.01%
==========================================
Files 55 55
Lines 2423 2430 +7
Branches 136 137 +1
==========================================
+ Hits 2329 2336 +7
Misses 57 57
Partials 37 37 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
auto-merge was automatically disabled
September 10, 2026 04:36
Head branch was pushed to by a user without write access
Contributor
Author
|
Closed the patch-coverage gap Codecov flagged on compat.py: added tests/test_compat.py with direct unit tests for both version branches of inject_fixture — node= on pytest 9.1+ and the legacy nodeid= path (via a mocked pytest_version, since no CI job runs pytest < 9.1). Both pass locally along with the existing given-injection regression test. |
Contributor
|
can you add pytest 9.1 to the |
youtux
enabled auto-merge
September 14, 2026 20:01
- refine Python versions, pytest, and gherkin configurations - avoid cartesian product of pytest ✕ gherkin_official
youtux
force-pushed
the
fix-register-fixture-node-deprecation
branch
from
September 14, 2026 20:25
9784146 to
e05e4d8
Compare
youtux
disabled auto-merge
September 14, 2026 20:34
wahidyankf
added a commit
to wahidyankf/proto-account-ledger-py
that referenced
this pull request
Sep 24, 2026
… deprecation warnings pytest-bdd 8.1.0 passes arguments that pytest 9.1 deprecates, so every test level warned PytestRemovedIn10Warning. The fix (pytest-dev/pytest-bdd#827) is merged but unreleased; lift the cap once a later pytest-bdd ships it.
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.
Closes #823
inject_fixturecallsFixtureManager._register_fixture(nodeid=...), which pytest 9.1 deprecated in favour ofnode=, so every scenario using atarget_fixtureemitsPytestRemovedIn10Warning(and fails outright in suites that error on deprecation warnings). Now passesnode=request.nodeon pytest >= 9.1 and keepsnodeidon older versions, matching the existing version-branching incompat.py.Regression test added in
tests/steps/test_given.py; it fails on master and passes with the fix. Full suite is unchanged on pytest 9.1, andtests/steps+tests/featurestill pass on pytest 9.0.