Skip to content

Commit 964a1c5

Browse files
committed
skip contextvars tests for Py<3.7
1 parent e1af5a0 commit 964a1c5

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

tests/python/test_tasks.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2110,6 +2110,7 @@ async def coro():
21102110

21112111
self.loop.run_until_complete(coro())
21122112

2113+
@unittest.skipIf(sys.version_info < (3, 7), "no contextvars in asyncio")
21132114
def test_context_1(self):
21142115
cvar = contextvars.ContextVar('cvar', default='nope')
21152116

@@ -2133,6 +2134,7 @@ async def main():
21332134
finally:
21342135
loop.close()
21352136

2137+
@unittest.skipIf(sys.version_info < (3, 7), "no contextvars in asyncio")
21362138
def test_context_2(self):
21372139
cvar = contextvars.ContextVar('cvar', default='nope')
21382140

@@ -2167,6 +2169,7 @@ def fut_on_done(fut):
21672169

21682170
self.assertEqual(cvar.get(), 'nope')
21692171

2172+
@unittest.skipIf(sys.version_info < (3, 7), "no contextvars in asyncio")
21702173
def test_context_3(self):
21712174
# Run 100 Tasks in parallel, each modifying cvar.
21722175

0 commit comments

Comments
 (0)