-
-
Notifications
You must be signed in to change notification settings - Fork 71
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Logging hookwrapper hides exceptions #98
Comments
Hmm you're right, it should use |
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 pytest-dev/pytest-bdd#155 (which is probably hiding another exception... 😱) Maybe this should just be fixed without a regression test because it might be difficult to get one? 😉 |
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! 😄 |
I'm currently investigating a problem with
pytest-bdd
where it raises anINTERNALERROR>
- unfortunately,pytest-qt
hides it with another one 😉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?The text was updated successfully, but these errors were encountered: