From 73cbf35b59ffcb3963d6e6afde730954342e933a Mon Sep 17 00:00:00 2001 From: Pierre Sassoulas Date: Sat, 23 May 2026 16:27:18 +0200 Subject: [PATCH] fix: use node= instead of deprecated nodeid= in unittest skip fixture PR #14210 registered the new skip fixture with `nodeid=self.nodeid`, the legacy string-baseid path that 121d7a42a 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. --- src/_pytest/unittest.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/_pytest/unittest.py b/src/_pytest/unittest.py index b83a6ed0c56..84435b3e09f 100644 --- a/src/_pytest/unittest.py +++ b/src/_pytest/unittest.py @@ -190,7 +190,7 @@ def unittest_skip_fixture(request: FixtureRequest) -> None: self.session._fixturemanager._register_fixture( name=f"_unittest_skip_fixture_{cls.__qualname__}", func=unittest_skip_fixture, - nodeid=self.nodeid, + node=self, scope="class", autouse=True, )