diff --git a/tests/conftest.py b/tests/conftest.py index e72ec0ef8..0bbd1bf83 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -13,7 +13,7 @@ import textwrap import pytest # Early diagnostic for failed imports -import pybind11_tests # noqa: F401 +import pybind11_tests _long_marker = re.compile(r"([0-9])L") _hexadecimal = re.compile(r"0x[0-9a-fA-F]+") @@ -196,5 +196,11 @@ def gc_collect(): def pytest_configure(): + print( + "PYBIND11_INTERNALS_ID & C++ Version:", + pybind11_tests.PYBIND11_INTERNALS_ID, + pybind11_tests.cpp_version_in_use, + flush=True, + ) pytest.suppress = suppress pytest.gc_collect = gc_collect diff --git a/tests/pybind11_tests.cpp b/tests/pybind11_tests.cpp index 3c0469915..54355b06e 100644 --- a/tests/pybind11_tests.cpp +++ b/tests/pybind11_tests.cpp @@ -65,6 +65,9 @@ void bind_ConstructorStats(py::module_ &m) { PYBIND11_MODULE(pybind11_tests, m) { m.doc() = "pybind11 test module"; + m.attr("cpp_version_in_use") = py::detail::cpp_version_in_use(); + m.attr("PYBIND11_INTERNALS_ID") = PYBIND11_INTERNALS_ID; + bind_ConstructorStats(m); #if defined(PYBIND11_DETAILED_ERROR_MESSAGES)