-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Closed
Labels
topic: tracebacksrelated to displaying and handling of tracebacksrelated to displaying and handling of tracebackstype: bugproblem that needs to be addressedproblem that needs to be addressed
Description
On Python 3, with this code:
def bar():
__tracebackhide__ = True
raise ValueError
def assert_foo():
__tracebackhide__ = True
bar()
def test_foo():
assert_foo()
I get a nice cleaned up traceback as I'd expect:
_____________________ test_foo ______________________
def test_foo():
> assert_foo()
E ValueError
tbh.py:10: ValueError
However, if I re-raise the exception:
def bar():
__tracebackhide__ = True
raise ValueError
def assert_foo():
__tracebackhide__ = True
try:
bar()
except ValueError:
raise TypeError
def test_foo():
assert_foo()
The traceback gets quite verbose:
_____________________ test_foo ______________________
def assert_foo():
__tracebackhide__ = True
try:
> bar()
tbh.py:8:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
def bar():
__tracebackhide__ = True
> raise ValueError
E ValueError
tbh.py:3: ValueError
During handling of the above exception, another exception occurred:
def test_foo():
> assert_foo()
E TypeError
tbh.py:13: TypeError
cc @roolebo
maxfischer2781
Metadata
Metadata
Assignees
Labels
topic: tracebacksrelated to displaying and handling of tracebacksrelated to displaying and handling of tracebackstype: bugproblem that needs to be addressedproblem that needs to be addressed