MCPcopy Create free account
hub / github.com/pybind/pybind11 / pytest_report_header

Function pytest_report_header

tests/conftest.py:262–291  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

260
261
262def pytest_report_header():
263 assert pybind11_tests.compiler_info is not None, (
264 "Please update pybind11_tests.cpp if this assert fails."
265 )
266 interesting_packages = ("pybind11", "numpy", "scipy", "build")
267 valid = []
268 for package in sorted(interesting_packages):
269 with contextlib.suppress(ModuleNotFoundError):
270 valid.append(f"{package}=={importlib.metadata.version(package)}")
271 reqs = " ".join(valid)
272
273 cpp_info = [
274 "C++ Info:",
275 f"{pybind11_tests.compiler_info}",
276 f"{pybind11_tests.cpp_std}",
277 f"{pybind11_tests.PYBIND11_INTERNALS_ID}",
278 f"PYBIND11_SIMPLE_GIL_MANAGEMENT={pybind11_tests.PYBIND11_SIMPLE_GIL_MANAGEMENT}",
279 ]
280 if "__graalpython__" in sys.modules:
281 cpp_info.append(
282 f"GraalPy version: {sys.modules['__graalpython__'].get_graalvm_version()}"
283 )
284 lines = [
285 f"installed packages of interest: {reqs}",
286 " ".join(cpp_info),
287 ]
288 if sysconfig.get_config_var("Py_GIL_DISABLED"):
289 lines.append("free-threaded Python build")
290
291 return lines
292
293
294@pytest.fixture

Callers

nothing calls this directly

Calls 2

appendMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected