mirror of
https://github.com/cool-RR/PySnooper.git
synced 2026-01-23 10:15:11 +00:00
Make tests even nicer
This commit is contained in:
parent
1ef8beb90b
commit
85c929285e
1 changed files with 6 additions and 2 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue