|
29 | 29 | from _pytest.mark.structures import MarkDecorator
|
30 | 30 | from _pytest.mark.structures import NodeKeywords
|
31 | 31 | from _pytest.outcomes import fail
|
32 |
| -from _pytest.outcomes import Failed |
33 | 32 | from _pytest.store import Store
|
34 | 33 |
|
35 | 34 | if TYPE_CHECKING:
|
@@ -332,19 +331,15 @@ def _prunetraceback(self, excinfo):
|
332 | 331 | pass
|
333 | 332 |
|
334 | 333 | def _repr_failure_py(
|
335 |
| - self, |
336 |
| - excinfo: ExceptionInfo[ |
337 |
| - Union[Failed, FixtureLookupError, ConftestImportFailure] |
338 |
| - ], |
339 |
| - style=None, |
| 334 | + self, excinfo: ExceptionInfo[BaseException], style=None, |
340 | 335 | ) -> Union[str, ReprExceptionInfo, ExceptionChainRepr, FixtureLookupErrorRepr]:
|
| 336 | + if isinstance(excinfo.value, ConftestImportFailure): |
| 337 | + excinfo = ExceptionInfo(excinfo.value.excinfo) |
341 | 338 | if isinstance(excinfo.value, fail.Exception):
|
342 | 339 | if not excinfo.value.pytrace:
|
343 | 340 | return str(excinfo.value)
|
344 | 341 | if isinstance(excinfo.value, FixtureLookupError):
|
345 | 342 | return excinfo.value.formatrepr()
|
346 |
| - if isinstance(excinfo.value, ConftestImportFailure): |
347 |
| - excinfo = ExceptionInfo(excinfo.value.excinfo) # type: ignore |
348 | 343 | if self.config.getoption("fulltrace", False):
|
349 | 344 | style = "long"
|
350 | 345 | else:
|
|
0 commit comments