MCPcopy
hub / github.com/pytest-dev/pytest / test_setup

Method test_setup

testing/test_runner.py:29–37  ·  testing/test_runner.py::TestSetupState.test_setup
(self, pytester: Pytester)

Source from the content-addressed store, hash-verified

27
28class TestSetupState:
29 def test_setup(self, pytester: Pytester) -> None:
30 item = pytester.getitem(class="st">"def test_func(): pass")
31 ss = item.session._setupstate
32 values = [1]
33 ss.setup(item)
34 ss.addfinalizer(values.pop, item)
35 assert values
36 ss.teardown_exact(None)
37 assert not values
38
39 def test_teardown_exact_stack_empty(self, pytester: Pytester) -> None:
40 item = pytester.getitem(class="st">"def test_func(): pass")

Callers

nothing calls this directly

Calls 4

teardown_exactMethod · 0.80
getitemMethod · 0.45
setupMethod · 0.45
addfinalizerMethod · 0.45

Tested by

no test coverage detected