@@ -47,20 +47,23 @@ def pytest_fixture_setup(
47
47
else :
48
48
param = request .param
49
49
fixturedef .cached_param = param # type: ignore[attr-defined]
50
- _show_fixture_action (fixturedef , "SETUP" )
50
+ _show_fixture_action (fixturedef , request . config , "SETUP" )
51
51
52
52
53
- def pytest_fixture_post_finalizer (fixturedef : FixtureDef [object ]) -> None :
53
+ def pytest_fixture_post_finalizer (
54
+ fixturedef : FixtureDef [object ], request : SubRequest
55
+ ) -> None :
54
56
if fixturedef .cached_result is not None :
55
- config = fixturedef . _fixturemanager .config
57
+ config = request .config
56
58
if config .option .setupshow :
57
- _show_fixture_action (fixturedef , "TEARDOWN" )
59
+ _show_fixture_action (fixturedef , request . config , "TEARDOWN" )
58
60
if hasattr (fixturedef , "cached_param" ):
59
61
del fixturedef .cached_param # type: ignore[attr-defined]
60
62
61
63
62
- def _show_fixture_action (fixturedef : FixtureDef [object ], msg : str ) -> None :
63
- config = fixturedef ._fixturemanager .config
64
+ def _show_fixture_action (
65
+ fixturedef : FixtureDef [object ], config : Config , msg : str
66
+ ) -> None :
64
67
capman = config .pluginmanager .getplugin ("capturemanager" )
65
68
if capman :
66
69
capman .suspend_global_capture ()
0 commit comments