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

Function test_setUpModule_failing_no_teardown

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

Source from the content-addressed store, hash-verified

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