Files
pytest2/py/test/testing/test_api.py
holger krekel 2fd437e465 ref addresses 4
The first non-None value returned by a pytest_pyfunc_call hook
method now indicates that the function call has been performed.

--HG--
branch : trunk
2009-04-17 19:25:15 +02:00

15 lines
572 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.api.pytest_pyfunc_call(pyfuncitem=item)