(I somehow missed to reply to the list)

On Tuesday 4 June 2013 at 07:03, Nikolaus Rath wrote:
> @pytest.fixture(autouse=True)
> def add_stderr_check(request, capsys):
> def check_stderr():
> stderr = capsys.readouterr()[1]
> if 'exception' in stderr.lower():
> raise AssertionError('Suspicious output to stderr')
> request.addfinalizer(check_stderr)


Hi,

This might not be the answer to your question, but you should be aware of this 
issue:

https://bitbucket.org/hpk42/pytest/issue/287/fixture-finalizer-failure-causes-other

Raising exceptions in the fixture teardown will make other fixtures not being 
teared down, which can cause other tests to fail.

Cheers
Andreas 


_______________________________________________
Pytest-dev mailing list
Pytest-dev@python.org
http://mail.python.org/mailman/listinfo/pytest-dev

Reply via email to