Skip to content

Commit 6f49ae7

Browse files
committed
Fix wasm tests.
The lock tests were being picked up twice: once in test_lock.py and once in Test_testinternalcapi from test_misc.py. The Test_testinternalcapi was not skipping tests when the platform doesn't have threads. This moves the tests to test_misc.py, doesn't include them in Test_testinternalcapi, and skips them if the platform doesn't support threads.
1 parent f963fd8 commit 6f49ae7

File tree

2 files changed

+9
-20
lines changed

2 files changed

+9
-20
lines changed

Lib/test/test_capi/test_lock.py

Lines changed: 0 additions & 19 deletions
This file was deleted.

Lib/test/test_capi/test_misc.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2067,7 +2067,15 @@ def test_version_api_data(self):
20672067
class Test_testinternalcapi(unittest.TestCase):
20682068
locals().update((name, getattr(_testinternalcapi, name))
20692069
for name in dir(_testinternalcapi)
2070-
if name.startswith('test_'))
2070+
if name.startswith('test_')
2071+
and not name.startswith('test_lock_'))
2072+
2073+
2074+
@threading_helper.requires_working_threading()
2075+
class Test_PyLock(unittest.TestCase):
2076+
locals().update((name, getattr(_testinternalcapi, name))
2077+
for name in dir(_testinternalcapi)
2078+
if name.startswith('test_lock_'))
20712079

20722080

20732081
@unittest.skipIf(_testmultiphase is None, "test requires _testmultiphase module")

0 commit comments

Comments
 (0)