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

Method setup

src/_pytest/unittest.py:188–195  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

186 _testcase: Optional["unittest.TestCase"] = None
187
188 def setup(self) -> None:
189 # A bound method to be called during teardown() if set (see 'runtest()').
190 self._explicit_tearDown: Optional[Callable[[], None]] = None
191 assert self.parent is not None
192 self._testcase = self.parent.obj(self.name) # type: ignore[attr-defined]
193 self._obj = getattr(self._testcase, self.name)
194 if hasattr(self, "_request"):
195 self._request._fillfixtures()
196
197 def teardown(self) -> None:
198 if self._explicit_tearDown is not None:

Callers

nothing calls this directly

Calls 2

objMethod · 0.80
_fillfixturesMethod · 0.80

Tested by

no test coverage detected