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

Method add_cleanup

src/_pytest/config/__init__.py:1196–1200  ·  view source on GitHub ↗

Add a function to be called when the config object gets out of use (usually coinciding with pytest_unconfigure).

(self, func: Callable[[], None])

Source from the content-addressed store, hash-verified

1194 return self._inipath
1195
1196 def add_cleanup(self, func: Callable[[], None]) -> None:
1197 """Add a function to be called when the config object gets out of
1198 use (usually coinciding with pytest_unconfigure).
1199 """
1200 self._cleanup_stack.callback(func)
1201
1202 def _do_configure(self) -> None:
1203 assert not self._configured

Callers 12

pytest_configureFunction · 0.80
pytest_configureFunction · 0.80
pytest_cmdline_parseFunction · 0.80
pytest_configureFunction · 0.80
pytest_configureFunction · 0.80
pytest_configureFunction · 0.80
pytest_configureFunction · 0.80
pytest_configureFunction · 0.80
install_importhookFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected