bpo-40280: Detect missing threading on WASM platforms (GH-32352)

Co-authored-by: Brett Cannon <brett@python.org>
This commit is contained in:
Christian Heimes 2022-04-07 10:22:47 +03:00 committed by GitHub
parent 5aee46b31b
commit 2b16a08bc7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
33 changed files with 103 additions and 21 deletions

View file

@ -1637,6 +1637,7 @@ class TestLRU:
for attr in self.module.WRAPPER_ASSIGNMENTS:
self.assertEqual(getattr(g, attr), getattr(f, attr))
@threading_helper.requires_working_threading()
def test_lru_cache_threaded(self):
n, m = 5, 11
def orig(x, y):
@ -1685,6 +1686,7 @@ class TestLRU:
finally:
sys.setswitchinterval(orig_si)
@threading_helper.requires_working_threading()
def test_lru_cache_threaded2(self):
# Simultaneous call with the same arguments
n, m = 5, 7
@ -1712,6 +1714,7 @@ class TestLRU:
pause.reset()
self.assertEqual(f.cache_info(), (0, (i+1)*n, m*n, i+1))
@threading_helper.requires_working_threading()
def test_lru_cache_threaded3(self):
@self.module.lru_cache(maxsize=2)
def f(x):
@ -2914,6 +2917,7 @@ class TestCachedProperty(unittest.TestCase):
self.assertEqual(item.get_cost(), 4)
self.assertEqual(item.cached_cost, 3)
@threading_helper.requires_working_threading()
def test_threaded(self):
go = threading.Event()
item = CachedCostItemWait(go)