Files
pytest2/py/test/testing/test_api.py
holger krekel 8182d341a5 rename "api" into "hook" in most places.
--HG--
branch : trunk
2009-05-07 18:01:53 +02:00

15 lines
573 B
Python

class TestPyfuncHooks:
def test_pyfunc_call(self, testdir):
item = testdir.getitem("def test_func(): raise ValueError")
config = item.config
class MyPlugin1:
def pytest_pyfunc_call(self, pyfuncitem, *args, **kwargs):
raise ValueError
class MyPlugin2:
def pytest_pyfunc_call(self, pyfuncitem, *args, **kwargs):
return True
config.pluginmanager.register(MyPlugin1())
config.pluginmanager.register(MyPlugin2())
config.hook.pytest_pyfunc_call(pyfuncitem=item)