compiler_info MSVC fix. num_violations == 0 condition.

This commit is contained in:
Ralf W. Grosse-Kunstleve 2022-06-22 17:41:11 -07:00
parent 0d2bf264c8
commit 491c2c7983
2 changed files with 8 additions and 2 deletions

View File

@ -79,7 +79,7 @@ PYBIND11_MODULE(pybind11_tests, m) {
m.doc() = "pybind11 test module";
#if defined(_MSC_FULL_VER)
m.attr("compiler_info") = "MSVC " _MSC_FULL_VER;
m.attr("compiler_info") = "MSVC " PYBIND11_TOSTRING(_MSC_FULL_VER);
#elif defined(__VERSION__)
m.attr("compiler_info") = __VERSION__;
#else

View File

@ -36,7 +36,13 @@ def test_type_caster_odr_violation_detected_counter():
num_violations = m.type_caster_odr_violation_detected_count()
if num_violations is None:
pytest.skip("type_caster_odr_violation_detected_count() is None")
elif num_violations == 0:
elif num_violations == 0 and (
# 3.9-dbg (deadsnakes) Valgrind x64:
# This failure is unexplained and the condition here is not completely specific,
# but deemed a good-enough workaround.
pybind11_tests.compiler_info == "9.4.0"
and pybind11_tests.cpp_std == "C++17"
):
pytest.skip(
"UNEXPECTED: type_caster_odr_violation_detected_count() == 0 (%s %s)"
% (pybind11_tests.compiler_info, pybind11_tests.cpp_std)