Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
skip await-eval
  • Loading branch information
Matthias Bussonnier
Matthias Bussonnier committed May 21, 2019
commit 09c453cceec8d67b2e636fcb2c7cd7cdff27d289
5 changes: 1 addition & 4 deletions Lib/test/test_builtin.py
Original file line number Diff line number Diff line change
Expand Up @@ -377,9 +377,6 @@ async def arange(n):
for i in range(n):
yield i

async def async_exec(co, *args):
await eval(co, *args)

modes = ('single', 'exec')
code_samples = ['''a = await asyncio.sleep(0, result=1)''',
'''async for i in arange(1):
Expand Down Expand Up @@ -410,7 +407,7 @@ async def async_exec(co, *args):
self.assertEqual(globals_['a'], 1)

globals_ = {'asyncio': asyncio, 'a':0, 'arange': arange}
asyncio.run(async_exec(co, globals_))
asyncio.run(eval(co, globals_))
self.assertEqual(globals_['a'], 1)
except Exception:

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I rewrote most of this, to also run via a FunctionType – though I believe creating FunctionTypes directly is not supposed to be done by usercode. and via run(eval())

asyncio.set_event_loop_policy(policy)
Expand Down