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

Method test_pyfunc_call

testing/python/collect.py:646–661  ·  view source on GitHub ↗
(self, pytester: Pytester)

Source from the content-addressed store, hash-verified

644 assert not (items[0] == items[1])
645
646 def test_pyfunc_call(self, pytester: Pytester) -> None:
647 item = pytester.getitem("def test_func(): raise ValueError")
648 config = item.config
649
650 class MyPlugin1:
651 def pytest_pyfunc_call(self):
652 raise ValueError
653
654 class MyPlugin2:
655 def pytest_pyfunc_call(self):
656 return True
657
658 config.pluginmanager.register(MyPlugin1())
659 config.pluginmanager.register(MyPlugin2())
660 config.hook.pytest_runtest_setup(item=item)
661 config.hook.pytest_pyfunc_call(pyfuncitem=item)
662
663 def test_multiple_parametrize(self, pytester: Pytester) -> None:
664 modcol = pytester.getmodulecol(

Callers

nothing calls this directly

Calls 6

MyPlugin1Class · 0.85
MyPlugin2Class · 0.85
registerMethod · 0.80
getitemMethod · 0.45
pytest_runtest_setupMethod · 0.45
pytest_pyfunc_callMethod · 0.45

Tested by

no test coverage detected