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

Method addfinalizer

src/_pytest/fixtures.py:792–795  ·  view source on GitHub ↗

Add finalizer/teardown function to be called after the last test within the requesting test context finished execution.

(self, finalizer: Callable[[], object])

Source from the content-addressed store, hash-verified

790 return f"<SubRequest {self.fixturename!r} for {self._pyfuncitem!r}>"
791
792 def addfinalizer(self, finalizer: Callable[[], object]) -> None:
793 """Add finalizer/teardown function to be called after the last test
794 within the requesting test context finished execution."""
795 self._fixturedef.addfinalizer(finalizer)
796
797 def _schedule_finalizers(
798 self, fixturedef: "FixtureDef[object]", subrequest: "SubRequest"

Callers 5

_addfinalizerMethod · 0.45
_schedule_finalizersMethod · 0.45
_schedule_finalizersMethod · 0.45
call_fixture_funcFunction · 0.45
executeMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected