Skip to content

[master] Debugging test_cross_module_exception_translator issue #4054

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ set(PYBIND11_TEST_FILES
test_eigen
test_enum
test_eval
test_exc_namespace_visibility.py
test_exceptions
test_factory_constructors
test_gil_scoped
Expand Down Expand Up @@ -217,6 +218,8 @@ tests_extra_targets("test_exceptions.py;test_local_bindings.py;test_stl.py;test_
# And add additional targets for other tests.
tests_extra_targets("test_exceptions.py" "cross_module_interleaved_error_already_set")
tests_extra_targets("test_gil_scoped.py" "cross_module_gil_utils")
tests_extra_targets("test_exc_namespace_visibility.py"
"namespace_visibility_1;namespace_visibility_2")

set(PYBIND11_EIGEN_REPO
"https://gitlab.com/libeigen/eigen.git"
Expand Down
3 changes: 3 additions & 0 deletions tests/namespace_visibility_1.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#include "pybind11/pybind11.h"

PYBIND11_MODULE(namespace_visibility_1, m) { m.doc() = "ns_vis_1"; }
3 changes: 3 additions & 0 deletions tests/namespace_visibility_2.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#include "pybind11/pybind11.h"

PYBIND11_MODULE(namespace_visibility_2, m) { m.doc() = "ns_vis_2"; }
16 changes: 16 additions & 0 deletions tests/test_exc_namespace_visibility.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import namespace_visibility_1
import namespace_visibility_2
import pytest

import pybind11_cross_module_tests as cm


def test_namespace_visibility():
assert cm.__doc__ is not None
modules = (
namespace_visibility_1,
namespace_visibility_2,
)
for m in modules:
if m.__doc__ != "ns_vis_1":
pytest.skip(f"Not surprised: {m.__doc__}")