mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
bpo-40280: Detect missing threading on WASM platforms (GH-32352)
Co-authored-by: Brett Cannon <brett@python.org>
This commit is contained in:
parent
5aee46b31b
commit
2b16a08bc7
33 changed files with 103 additions and 21 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue