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

Function test_setUpModule

testing/test_unittest.py:88–107  ·  view source on GitHub ↗
(pytester: Pytester)

Source from the content-addressed store, hash-verified

86
87
88def test_setUpModule(pytester: Pytester) -> None:
89 testpath = pytester.makepyfile(
90 """
91 values = []
92
93 def setUpModule():
94 values.append(1)
95
96 def tearDownModule():
97 del values[0]
98
99 def test_hello():
100 assert values == [1]
101
102 def test_world():
103 assert values == [1]
104 """
105 )
106 result = pytester.runpytest(testpath)
107 result.stdout.fnmatch_lines(["*2 passed*"])
108
109
110def test_setUpModule_failing_no_teardown(pytester: Pytester) -> None:

Callers

nothing calls this directly

Calls 3

fnmatch_linesMethod · 0.80
makepyfileMethod · 0.45
runpytestMethod · 0.45

Tested by

no test coverage detected