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 3fe80c7 commit 3dc7d38Copy full SHA for 3dc7d38
src/_pytest/debugging.py
@@ -11,7 +11,6 @@
11
import sys
12
import types
13
from typing import Any
14
-import unittest
15
16
from _pytest import outcomes
17
from _pytest._code import ExceptionInfo
@@ -296,7 +295,8 @@ def pytest_exception_interact(
296
295
sys.stdout.write(err)
297
assert call.excinfo is not None
298
299
- if not isinstance(call.excinfo.value, unittest.SkipTest):
+ unittest = sys.modules.get("unittest")
+ if unittest is None or not isinstance(call.excinfo.value, unittest.SkipTest):
300
_enter_pdb(node, call.excinfo, report)
301
302
def pytest_internalerror(self, excinfo: ExceptionInfo[BaseException]) -> None:
0 commit comments