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

Method test_pyfunc_call

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

Source from the content-addressed store, hash-verified

540 assert not (items[0] == items[1])
541
542 def test_pyfunc_call(self, pytester: Pytester) -> None:
543 item = pytester.getitem("def test_func(): raise ValueError")
544 config = item.config
545
546 class MyPlugin1:
547 def pytest_pyfunc_call(self):
548 raise ValueError
549
550 class MyPlugin2:
551 def pytest_pyfunc_call(self):
552 return True
553
554 config.pluginmanager.register(MyPlugin1())
555 config.pluginmanager.register(MyPlugin2())
556 config.hook.pytest_runtest_setup(item=item)
557 config.hook.pytest_pyfunc_call(pyfuncitem=item)
558
559 def test_multiple_parametrize(self, pytester: Pytester) -> None:
560 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