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

Function test_setUpModule_failing_no_teardown

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

Source from the content-addressed store, hash-verified

109
110
111def test_setUpModule_failing_no_teardown(pytester: Pytester) -> None:
112 testpath = pytester.makepyfile(
113 """
114 values = []
115
116 def setUpModule():
117 0/0
118
119 def tearDownModule():
120 values.append(1)
121
122 def test_hello():
123 pass
124 """
125 )
126 reprec = pytester.inline_run(testpath)
127 reprec.assertoutcome(passed=0, failed=1)
128 call = reprec.getcalls("pytest_runtest_setup")[0]
129 assert not call.item.module.values
130
131
132def test_new_instances(pytester: Pytester) -> None:

Callers

nothing calls this directly

Calls 4

assertoutcomeMethod · 0.80
getcallsMethod · 0.80
makepyfileMethod · 0.45
inline_runMethod · 0.45

Tested by

no test coverage detected