Skip to content

Commit e53d58a

Browse files
authored
Ensure import pybind11_tests traceback is shown. (#4455)
1 parent d821788 commit e53d58a

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

tests/conftest.py

+7-1
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,17 @@
1111
import os
1212
import re
1313
import textwrap
14+
import traceback
1415

1516
import pytest
1617

1718
# Early diagnostic for failed imports
18-
import pybind11_tests
19+
try:
20+
import pybind11_tests
21+
except Exception:
22+
# pytest does not show the traceback without this.
23+
traceback.print_exc()
24+
raise
1925

2026

2127
@pytest.fixture(scope="session", autouse=True)

0 commit comments

Comments
 (0)