Skip to content

Commit 11ca979

Browse files
committed
fix/harden assertion
1 parent aa42fe0 commit 11ca979

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/_pytest/runner.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
from .reports import CollectErrorRepr
1515
from .reports import CollectReport
1616
from .reports import TestReport
17+
from _pytest._code.code import ExceptionChainRepr
1718
from _pytest._code.code import ExceptionInfo
18-
from _pytest._code.code import ExceptionRepr
1919
from _pytest.compat import TYPE_CHECKING
2020
from _pytest.nodes import Collector
2121
from _pytest.nodes import Node
@@ -267,7 +267,7 @@ def pytest_make_collect_report(collector: Collector) -> CollectReport:
267267
if call.excinfo.errisinstance(tuple(skip_exceptions)):
268268
outcome = "skipped"
269269
r_ = collector._repr_failure_py(call.excinfo, "line")
270-
assert isinstance(r_, ExceptionRepr), r_
270+
assert isinstance(r_, ExceptionChainRepr), repr(r_)
271271
r = r_.reprcrash
272272
assert r
273273
longrepr = (str(r.path), r.lineno, r.message)

0 commit comments

Comments
 (0)