Closed The-Compiler closed 9 years ago
Hmm you're right, it should use outcome.get_result()
. Thanks! :smile:
I tried writing a test for this:
def test_logging_broken_makereport(testdir):
"""
Make sure logging's makereport hookwrapper doesn't hide exceptions.
See https://github.com/pytest-dev/pytest-qt/issues/98
:type testdir: _pytest.pytester.TmpTestdir
"""
testdir.makepyfile(
conftest="""
import pytest
@pytest.mark.hookwrapper(tryfirst=True)
def pytest_runtest_makereport():
raise Exception("This should not be hidden")
""")
testdir.makepyfile(
"""
def test_foo():
pass
"""
)
res = testdir.runpytest()
res.stdout.fnmatch_lines([
'*This should not be hidden*',
])
but it passes...
The error I got with pytest-bdd in the hidden exception was https://github.com/pytest-dev/pytest-bdd/issues/155 (which is probably hiding another exception... :scream:)
Maybe this should just be fixed without a regression test because it might be difficult to get one? :wink:
Thanks for trying! I will give it a shot myself, but I agree that it should just be fixed even if we can't find a proper test for it.
I was able to modify your test a bit to make the test fail as we expected (27a1aaa). Thanks! :smile:
I'm currently investigating a problem with
pytest-bdd
where it raises anINTERNALERROR>
- unfortunately,pytest-qt
hides it with another one :wink:Looking at it with
pdb
, that seems to be the case because there was an exception:Shouldn't
pytest-qt
useoutcome.get_result()
instead which raises the exception if there is any?