mirror of
https://github.com/pybind/pybind11.git
synced 2026-03-14 20:27:47 +00:00
Report C++ Info: via pytest_report_header() (#4046)
* Report `C++ Info:` from `pytest_configure()` * Use pytest_report_header() as suggested by @skylion007
This commit is contained in:
committed by
GitHub
parent
cd08869df1
commit
85bc088441
@@ -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]+")
|
||||
@@ -198,3 +198,16 @@ def gc_collect():
|
||||
def pytest_configure():
|
||||
pytest.suppress = suppress
|
||||
pytest.gc_collect = gc_collect
|
||||
|
||||
|
||||
def pytest_report_header(config):
|
||||
del config # Unused.
|
||||
assert (
|
||||
pybind11_tests.compiler_info is not None
|
||||
), "Please update pybind11_tests.cpp if this assert fails."
|
||||
return (
|
||||
"C++ Info:"
|
||||
f" {pybind11_tests.compiler_info}"
|
||||
f" {pybind11_tests.cpp_std}"
|
||||
f" {pybind11_tests.PYBIND11_INTERNALS_ID}"
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user