We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 480d125 commit 44637edCopy full SHA for 44637ed
tests/_setup_test_env.py
@@ -91,8 +91,14 @@ def _try_hook_into_tests():
91
92
Also see: https://youtrack.jetbrains.com/issue/PY-9848
93
"""
94
- # get TestProgram instance from stack...
+ # Check if this is run inside a debugger. Skip if this is not the case.
95
import sys
96
+ get_trace = getattr(sys, "gettrace", None)
97
+ if not get_trace:
98
+ return
99
+ if get_trace() is None:
100
101
+ # get TestProgram instance from stack...
102
from unittest import TestProgram
103
from better_exchook import get_current_frame
104
frame = get_current_frame()
0 commit comments