You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Consider a test that raises an exception, after catching some other exception, and chaining them:
def test_that_raises():
try:
raise Exception('I want to know the type of exception and this message somewhere")
except Exception as ex:
raise Exception('A new custom exception that is more general') from ex
The test report shows the second Exception instance and its information but does not include the chained exception and its information. This is important for debugging and Python 3.4 appears to show a nice trace of both if left uncaught (outside of pytest).
The text was updated successfully, but these errors were encountered:
Consider a test that raises an exception, after catching some other exception, and chaining them:
def test_that_raises():
try:
raise Exception('I want to know the type of exception and this message somewhere")
except Exception as ex:
raise Exception('A new custom exception that is more general') from ex
The test report shows the second Exception instance and its information but does not include the chained exception and its information. This is important for debugging and Python 3.4 appears to show a nice trace of both if left uncaught (outside of pytest).
The text was updated successfully, but these errors were encountered: