add a way to mark hooks as "tryfirst" or "trylast" to influence its position in a hook chain.

Use 'tryfirst' for capturing hooks so they can start capturing as early as possible,
including when conftests add output in runtest_setup hooks.
This commit is contained in:
holger krekel
2010-11-21 23:17:59 +01:00
parent f456e376b9
commit bc42cf8ffb
8 changed files with 62 additions and 9 deletions

View File

@@ -19,8 +19,8 @@ def pytest_cmdline_main(config):
showfuncargs(config)
return 0
def pytest_namespace(__multicall__):
__multicall__.execute()
@pytest.mark.trylast
def pytest_namespace():
raises.Exception = pytest.fail.Exception
return {
'raises' : raises,