We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
py.test pytest (2.8.5) does not print chained exceptions, data located in e.__cause__ and e.__context__.
e.__cause__
e.__context__
If I execute this little script using python3 (python3 test_exception.py):
python3 test_exception.py
def test_x(): try: raise KeyError except Exception as e: raise RuntimeError from e if __name__ == '__main__': test_x()
I get:
Traceback (most recent call last): File "py_test.py", line 4, in test_x raise KeyError KeyError The above exception was the direct cause of the following exception: Traceback (most recent call last): File "py_test.py", line 9, in <module> test_x() File "py_test.py", line 6, in test_x raise RuntimeError from e RuntimeError
in case of py.test (py.test test_exception.py):
py.test test_exception.py
def test_x(): try: raise KeyError except Exception as e: > raise RuntimeError from e E RuntimeError py_test.py:6: RuntimeError
The text was updated successfully, but these errors were encountered:
Thanks @jettify!
Closing as a duplicate of #138 though.
This should be tackled soon, because what was blocking this issue was #103, which is a working in progress at #1199.
Sorry, something went wrong.
No branches or pull requests
py.test pytest (2.8.5) does not print chained exceptions, data located in
e.__cause__
ande.__context__
.If I execute this little script using python3 (
python3 test_exception.py
):I get:
in case of py.test (
py.test test_exception.py
):The text was updated successfully, but these errors were encountered: