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

Method addfinalizer

src/_pytest/nodes.py:376–383  ·  src/_pytest/nodes.py::Node.addfinalizer

Register a function to be called without arguments 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

374 return [x.name for x in self.listchain()]
375
376 def addfinalizer(self, fin: Callable[[], object]) -> None:
377 class="st">"""Register a function to be called without arguments when this node is
378 finalized.
379
380 This method can only be called when this node is active
381 in a setup chain, for example during self.setup().
382 class="st">"""
383 self.session._setupstate.addfinalizer(fin, self)
384
385 def getparent(self, cls: type[_NodeType]) -> _NodeType | None:
386 class="st">"""Get the closest parent node (including self) which is an instance of

Callers 13

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

Calls

no outgoing calls