Skip to content

Commit 19b39bb

Browse files
committed
Crude hack for Python 3.10
1 parent 306ef29 commit 19b39bb

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

tests/integration/test_mixed_concurrency.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import asyncio
2+
import sys
23
import unittest
34
from asyncio import sleep
45

@@ -29,13 +30,20 @@ async def start_server(self):
2930
await sleep(0.1)
3031

3132
async def asyncSetUp(self):
32-
async with asyncio.timeout(delay=2):
33+
if sys.version_info>=(3,11,0):
34+
async with asyncio.timeout(delay=2):
35+
asyncio.create_task(self.start_server())
36+
await asyncio.sleep(0.1)
37+
else:
3338
asyncio.create_task(self.start_server())
3439
await asyncio.sleep(0.1)
3540

3641
async def test_asyncio(self):
3742
context = AsyncioContext("pva")
38-
async with asyncio.timeout(delay=2):
43+
if sys.version_info>=(3,11,0):
44+
async with asyncio.timeout(delay=2):
45+
value = await context.get("demo:a")
46+
else:
3947
value = await context.get("demo:a")
4048

4149
assert value == 5.5

0 commit comments

Comments
 (0)