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

Function test_method_setup

testing/test_runner_xunit.py:127–143  ·  view source on GitHub ↗
(pytester: Pytester)

Source from the content-addressed store, hash-verified

125
126
127def test_method_setup(pytester: Pytester) -> None:
128 reprec = pytester.inline_runsource(
129 """
130 class TestSetupMethod(object):
131 def setup_method(self, meth):
132 self.methsetup = meth
133 def teardown_method(self, meth):
134 del self.methsetup
135
136 def test_some(self):
137 assert self.methsetup == self.test_some
138
139 def test_other(self):
140 assert self.methsetup == self.test_other
141 """
142 )
143 reprec.assertoutcome(passed=2)
144
145
146def test_method_setup_failure_no_teardown(pytester: Pytester) -> None:

Callers

nothing calls this directly

Calls 2

assertoutcomeMethod · 0.80
inline_runsourceMethod · 0.45

Tested by

no test coverage detected