'get_event_loop_policy', 'set_event_loop_policy',
'get_event_loop', 'set_event_loop', 'new_event_loop',
'get_child_watcher', 'set_child_watcher',
+ '_set_running_loop', '_get_running_loop',
]
import functools
try:
asyncio.set_event_loop_policy(Policy())
loop = asyncio.new_event_loop()
+ self.assertIs(asyncio._get_running_loop(), None)
async def func():
self.assertIs(asyncio.get_event_loop(), loop)
+ self.assertIs(asyncio._get_running_loop(), loop)
loop.run_until_complete(func())
finally:
if loop is not None:
loop.close()
+ self.assertIs(asyncio._get_running_loop(), None)
+
if __name__ == '__main__':
unittest.main()