Pretty pytest exceptions for threads #12682
Unanswered
jordanisaacs
asked this question in
Q&A
Replies: 1 comment 1 reply
-
The Exception info class provides the formatting |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have tests that spawn threads which can raise exceptions causing the test to fail. Is there a way to pass in the nice pytest exception handler/formatter to those threads so I can get more then just a stack trace. E.g. I want to show the locals.
Right now, I just print the exception and then call
assert False
on the main thread. This results in a nice pytest exception but in the wrong place. From what I can tellpytest/src/_pytest/_code/code.py
Line 618 in 5a01583
This is what the high level code looks like at the moment:
Beta Was this translation helpful? Give feedback.
All reactions