fix: use node= instead of deprecated nodeid= in unittest skip fixture#14505
Merged
RonnyPfannschmidt merged 1 commit intoMay 23, 2026
Merged
Conversation
PR pytest-dev#14210 registered the new skip fixture with `nodeid=self.nodeid`, the legacy string-baseid path that 121d7a4 deprecated in favor of `node=`. The legacy matching mis-scopes the autouse skip fixture so subclasses of a `@unittest.skip` class still execute their inherited `setUp` / `setUpClass`, breaking `test_setup_inheritance_skipping` and `test_pdb_teardown_skipped_for_classes[@unittest.skip]` on main. Align with the two existing `_register_unittest_setUp*` fixtures in the same file.
Member
Author
|
@nicoddemus fyi, I broke main when merging #14210 |
RonnyPfannschmidt
approved these changes
May 23, 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.
Summary
mainis red on every platform since #14210 landed. The PR was written in February against the old_register_fixture(nodeid=...)API, but commit 121d7a4 deprecated that path yesterday in favor ofnode=. The PR was approved before that refactor and never re-rebased, so the regression landed unseen — its own CI run was cancelled by the doc-PR merges that immediately followed.Root cause
_register_unittest_skip_fixtureregisters an autouse fixture withnodeid=self.nodeid, which now hits the legacy string-baseid path. That path scopes the fixture by string prefix and mis-attributes it relative to subclasses of a@unittest.skip-decorated class — so the skip fixture never preempts the inheritedsetUp/setUpClass, and tests that should report1 skippedinstead error out.Three existing tests are broken on every Python/OS:
test_setup_inheritance_skipping[test_setup_skip.py-1 skipped]test_setup_inheritance_skipping[test_setup_skip_class.py-1 skipped]test_pdb_teardown_skipped_for_classes[@unittest.skip]The two existing
_register_unittest_setUp*fixtures in the same file already usenode=self. This PR aligns the new fixture with that convention.Test plan
pytest testing/test_unittest.py— 71 passed, 9 skipped locally🤖 Generated with Claude Code