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
The traceback in the output of the attached test (see below) doesn't include line 5, which is where the original exception is raised. I think this is because
uses the limit parameter to try to hide the implementation of self.fail() from the traceback, but traceback.TracebackException.format() applies the limit to the chained exception. I'm not sure if that's a bug in unittest or traceback, but from the comment in the above part of unittest, I don't think it's intentional.
F
======================================================================
FAIL: test_foo (main.FooTest)
----------------------------------------------------------------------
Traceback (most recent call last):
File "foo.py", line 12, in test_foo
foo()
ValueError: foo
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "foo.py", line 14, in test_fooself.fail('foo() raised ValueError')
AssertionError: foo() raised ValueError
I made a patch that replaces the limit hack by a filter on the traceback. We could stop here an just fix this, or we could create a more generic filter in the traceback module as suggested in bpo-31299.
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: