diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index c211290a73..e7aec339f3 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -148,6 +148,7 @@ set(PYBIND11_TEST_FILES test_eigen test_enum test_eval + test_exc_namespace_visibility.py test_exceptions test_factory_constructors test_gil_scoped @@ -157,7 +158,6 @@ set(PYBIND11_TEST_FILES test_methods_and_attributes test_modules test_multiple_inheritance - test_namespace_visibility.py test_numpy_array test_numpy_dtypes test_numpy_vectorize @@ -237,7 +237,8 @@ tests_extra_targets("test_exceptions.py" "cross_module_interleaved_error_already tests_extra_targets("test_gil_scoped.py" "cross_module_gil_utils") tests_extra_targets("test_class_sh_module_local.py" "class_sh_module_local_0;class_sh_module_local_1;class_sh_module_local_2") -tests_extra_targets("test_namespace_visibility.py" "namespace_visibility_1;namespace_visibility_2") +tests_extra_targets("test_exc_namespace_visibility.py" + "namespace_visibility_1;namespace_visibility_2") set(PYBIND11_EIGEN_REPO "https://gitlab.com/libeigen/eigen.git" diff --git a/tests/test_namespace_visibility.py b/tests/test_exc_namespace_visibility.py similarity index 88% rename from tests/test_namespace_visibility.py rename to tests/test_exc_namespace_visibility.py index 4d7919e5d5..0f1cab9d5b 100644 --- a/tests/test_namespace_visibility.py +++ b/tests/test_exc_namespace_visibility.py @@ -4,6 +4,13 @@ # `-fvisibility=hidden` or `__attribute__((visibility("hidden")))`, or linking # extensions statically with the core Python interpreter. +# NOTE +# ==== +# The "exc_" in "test_exc_namespace_visibility.py" is a workaround, to avoid a +# test_cross_module_exception_translator (test_exceptions.py) failure. This +# test has to be imported (by pytest) before test_exceptions.py; pytest sorts +# lexically. See https://github.com/pybind/pybind11/pull/4054 for more information. + import itertools import namespace_visibility_1