diff options
author | Yury Selivanov <yury@magic.io> | 2016-11-07 19:01:27 -0500 |
---|---|---|
committer | Yury Selivanov <yury@magic.io> | 2016-11-07 19:01:27 -0500 |
commit | cb4f0c53ffa171de8a6fa3aba6be2eb38d9f758e (patch) | |
tree | 58cf0023b208524b664149e614b0c789a87994db | |
parent | 621d4a7c8640d818d67d5f747852ed6ff961aa76 (diff) | |
parent | 1994dd360b052d85be9b02c44f2287468b157c10 (diff) | |
download | cpython-git-cb4f0c53ffa171de8a6fa3aba6be2eb38d9f758e.tar.gz |
Merge 3.6 (issue #28613)
-rw-r--r-- | Lib/asyncio/events.py | 1 | ||||
-rw-r--r-- | Lib/test/test_asyncio/test_events.py | 4 |
2 files changed, 5 insertions, 0 deletions
diff --git a/Lib/asyncio/events.py b/Lib/asyncio/events.py index 8575e2c1c4..28a45fc3cc 100644 --- a/Lib/asyncio/events.py +++ b/Lib/asyncio/events.py @@ -6,6 +6,7 @@ __all__ = ['AbstractEventLoopPolicy', '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 diff --git a/Lib/test/test_asyncio/test_events.py b/Lib/test/test_asyncio/test_events.py index 4c18300bab..d6489d5f8d 100644 --- a/Lib/test/test_asyncio/test_events.py +++ b/Lib/test/test_asyncio/test_events.py @@ -2732,9 +2732,11 @@ class PolicyTests(unittest.TestCase): 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: @@ -2742,6 +2744,8 @@ class PolicyTests(unittest.TestCase): if loop is not None: loop.close() + self.assertIs(asyncio._get_running_loop(), None) + if __name__ == '__main__': unittest.main() |