We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 27950d8 commit 0aed1e7Copy full SHA for 0aed1e7
Lib/test/test_capi.py
@@ -915,6 +915,21 @@ def callback():
915
t.start()
916
t.join()
917
918
+ @threading_helper.reap_threads
919
+ @threading_helper.requires_working_threading()
920
+ def test_gilstate_ensure_no_deadlock(self):
921
+ # See https://github.com/python/cpython/issues/96071
922
+ code = textwrap.dedent(f"""
923
+ import _testcapi
924
+
925
+ def callback():
926
+ print('callback called')
927
928
+ _testcapi._test_thread_state(callback)
929
+ """)
930
+ ret = assert_python_ok('-X', 'tracemalloc', '-c', code)
931
+ self.assertIn(b'callback called', ret.out)
932
933
934
class Test_testcapi(unittest.TestCase):
935
locals().update((name, getattr(_testcapi, name))
0 commit comments