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

Function test_method_setup

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

Source from the content-addressed store, hash-verified

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