Skip to content

Commit c5c7102

Browse files
committed
Test also PyThread_get_thread_native_id
1 parent fb2f8b1 commit c5c7102

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

Lib/test/test_capi.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -643,12 +643,14 @@ def test_Py_CompileString(self):
643643
expected = compile(code, "<string>", "exec")
644644
self.assertEqual(result.co_consts, expected.co_consts)
645645

646-
def test_export_frozenmain(self):
647-
# bpo-44133: Ensure that the "Py_FrozenMain" symbol is exported
648-
# by the Python (directly by the binary, or via by the Python dynamic
649-
# library).
646+
def test_export_symbols(self):
647+
# bpo-44133: Ensure that the "Py_FrozenMain" and
648+
# "PyThread_get_thread_native_id" symbols are exported by the Python
649+
# (directly by the binary, or via by the Python dynamic library).
650650
ctypes = import_helper.import_module('ctypes')
651-
self.assertTrue(hasattr(ctypes.pythonapi, 'Py_FrozenMain'))
651+
for name in ('Py_FrozenMain', 'PyThread_get_thread_native_id'):
652+
with self.subTest(name=name):
653+
self.assertTrue(hasattr(ctypes.pythonapi, name))
652654

653655

654656
class TestPendingCalls(unittest.TestCase):

0 commit comments

Comments
 (0)