Skip to content

Commit 65b1f46

Browse files
committed
Fixed traceback call (Python < 3.10 compat.)
1 parent c2aa548 commit 65b1f46

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tests/test_eager_preimports.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,9 +97,9 @@ def wrapper_pytest(request: pytest.FixtureRequest) -> None:
9797
# If setting up the test item fails (e.g. due to `pytest`
9898
# refactoring), fall back to the vanilla implementation with
9999
# a warning
100+
tb_lines = traceback.format_exception(type(e), e, e.__traceback__)
100101
msg = ('failed to convert `doctest.DocTest` into '
101-
'`pytest.Item`:\n\n'
102-
f'{"".join(traceback.format_exception(e))}\n'
102+
f'`pytest.Item`:\n\n{"".join(tb_lines)}\n'
103103
'falling back to vanilla `doctest`')
104104
warnings.warn(msg)
105105
return wrapper_vanilla()

0 commit comments

Comments
 (0)