MCPcopy Create free account
hub / github.com/pytest-dev/pytest / test_setup

Method test_setup

testing/test_runner.py:24–32  ·  view source on GitHub ↗
(self, pytester: Pytester)

Source from the content-addressed store, hash-verified

22
23class TestSetupState:
24 def test_setup(self, pytester: Pytester) -> None:
25 item = pytester.getitem("def test_func(): pass")
26 ss = item.session._setupstate
27 values = [1]
28 ss.setup(item)
29 ss.addfinalizer(values.pop, item)
30 assert values
31 ss.teardown_exact(None)
32 assert not values
33
34 def test_teardown_exact_stack_empty(self, pytester: Pytester) -> None:
35 item = pytester.getitem("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