From 85c929285efb03922db85a06e9795e0907735f9a Mon Sep 17 00:00:00 2001 From: Ram Rachum Date: Sat, 14 Sep 2019 10:17:26 +0300 Subject: [PATCH] Make tests even nicer --- tests/test_not_implemented.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tests/test_not_implemented.py b/tests/test_not_implemented.py index 245a184..65b2645 100644 --- a/tests/test_not_implemented.py +++ b/tests/test_not_implemented.py @@ -29,7 +29,9 @@ def test_rejecting_coroutine_functions(): async def foo(x): return 'lol' ''') - exec(code, globals()) + namespace = {} + exec(code, namespace) + foo = namespace['foo'] assert pycompat.iscoroutinefunction(foo) assert not pycompat.isasyncgenfunction(foo) @@ -45,7 +47,9 @@ def test_rejecting_async_generator_functions(): async def foo(x): yield 'lol' ''') - exec(code, globals()) + namespace = {} + exec(code, namespace) + foo = namespace['foo'] assert not pycompat.iscoroutinefunction(foo) assert pycompat.isasyncgenfunction(foo)