File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change 1+ import builtins
12import multiprocessing
23import threading
34
5+ import pytest
6+
47from pybind11_tests import gil_scoped as m
58
69
10+ def get_pybind11_internals_keys ():
11+ keys = []
12+ for key in sorted (dir (builtins )):
13+ if key .startswith ("__pybind11_internals_" ):
14+ assert key .endswith ("__" )
15+ keys .append (key )
16+ return tuple (keys )
17+
18+
719def _run_in_process (target , * args , ** kwargs ):
820 """Runs target in process and returns its exitcode after 10s (None if still alive)."""
921 process = multiprocessing .Process (target = target , args = args , kwargs = kwargs )
@@ -110,6 +122,14 @@ def test_cross_module_gil_acquired():
110122 m .test_cross_module_gil_acquired () # Should not raise a SIGSEGV
111123
112124
125+ def test_report_builtins_internals_keys ():
126+ """For reporting, not an actual test."""
127+ m .test_cross_module_gil_released () # Any test that imports cross_module_gil_utils
128+ keys = get_pybind11_internals_keys ()
129+ assert len (keys ) != 0
130+ pytest .skip ("builtins internals keys: %s" % ", " .join (keys ))
131+
132+
113133def test_cross_module_gil_inner_custom_released ():
114134 """Makes sure that the GIL can be acquired/released by another module
115135 from a GIL-released state using custom locking logic."""
You can’t perform that action at this time.
0 commit comments