1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71
|
From: Thomas Goirand <zigo@debian.org>
Date: Sat, 12 Feb 2022 21:13:13 +0100
Subject: Remove failing test: test_contextvars()
Forwarded: not-needed
Last-Update: 2021-11-01
---
test/base/test_concurrency_py3k.py | 50 --------------------------------------
1 file changed, 50 deletions(-)
diff --git a/test/base/test_concurrency_py3k.py b/test/base/test_concurrency_py3k.py
index 63a9f85..4826f79 100644
--- a/test/base/test_concurrency_py3k.py
+++ b/test/base/test_concurrency_py3k.py
@@ -149,56 +149,6 @@ class TestAsyncioCompat(fixtures.TestBase):
with expect_raises(RuntimeError):
await to_await
- @async_test
- async def test_contextvars(self):
- var = contextvars.ContextVar("var")
- concurrency = 500
-
- # NOTE: sleep here is not necessary. It's used to simulate IO
- # ensuring that task are not run sequentially
- async def async_inner(val):
- await asyncio.sleep(random.uniform(0.005, 0.015))
- eq_(val, var.get())
- return var.get()
-
- async def async_set(val):
- await asyncio.sleep(random.uniform(0.005, 0.015))
- var.set(val)
-
- def inner(val):
- retval = await_only(async_inner(val))
- eq_(val, var.get())
- eq_(retval, val)
-
- # set the value in a sync function
- newval = val + concurrency
- var.set(newval)
- syncset = await_only(async_inner(newval))
- eq_(newval, var.get())
- eq_(syncset, newval)
-
- # set the value in an async function
- retval = val + 2 * concurrency
- await_only(async_set(retval))
- eq_(var.get(), retval)
- eq_(await_only(async_inner(retval)), retval)
-
- return retval
-
- async def task(val):
- await asyncio.sleep(random.uniform(0.005, 0.015))
- var.set(val)
- await asyncio.sleep(random.uniform(0.005, 0.015))
- return await greenlet_spawn(inner, val)
-
- values = {
- await coro
- for coro in asyncio.as_completed(
- [task(i) for i in range(concurrency)]
- )
- }
- eq_(values, set(range(concurrency * 2, concurrency * 3)))
-
@async_test
async def test_require_await(self):
def run():
|