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

Method addfinalizer

src/_pytest/nodes.py:409–415  ·  view source on GitHub ↗

Register a function to be called when this node is finalized. This method can only be called when this node is active in a setup chain, for example during self.setup().

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

Source from the content-addressed store, hash-verified

407 return [x.name for x in self.listchain()]
408
409 def addfinalizer(self, fin: Callable[[], object]) -> None:
410 """Register a function to be called when this node is finalized.
411
412 This method can only be called when this node is active
413 in a setup chain, for example during self.setup().
414 """
415 self.session._setupstate.addfinalizer(fin, self)
416
417 def getparent(self, cls: Type[_NodeType]) -> Optional[_NodeType]:
418 """Get the next parent node (including self) which is an instance of

Callers 12

gethookrecorderMethod · 0.45
__init__Method · 0.45
make_hook_recorderMethod · 0.45
parseconfigMethod · 0.45
spawnMethod · 0.45
setupMethod · 0.45
pytest_runtest_setupFunction · 0.45
test_setupMethod · 0.45

Calls

no outgoing calls

Tested by 10

gethookrecorderMethod · 0.36
__init__Method · 0.36
make_hook_recorderMethod · 0.36
parseconfigMethod · 0.36
spawnMethod · 0.36
test_setupMethod · 0.36