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

Method setup

src/_pytest/python.py:668–682  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

666 self.name = self.path.parent.name
667
668 def setup(self) -> None:
669 # Not using fixtures to call setup_module here because autouse fixtures
670 # from packages are not called automatically (#4085).
671 setup_module = _get_first_non_fixture_func(
672 self.obj, ("setUpModule", "setup_module")
673 )
674 if setup_module is not None:
675 _call_with_optional_argument(setup_module, self.obj)
676
677 teardown_module = _get_first_non_fixture_func(
678 self.obj, ("tearDownModule", "teardown_module")
679 )
680 if teardown_module is not None:
681 func = partial(_call_with_optional_argument, teardown_module, self.obj)
682 self.addfinalizer(func)
683
684 def gethookproxy(self, fspath: "os.PathLike[str]"):
685 warnings.warn(FSCOLLECTOR_GETHOOKPROXY_ISINITPATH, stacklevel=2)

Callers

nothing calls this directly

Calls 3

addfinalizerMethod · 0.45

Tested by

no test coverage detected