diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2014-12-18 01:20:10 +0100 |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2014-12-18 01:20:10 +0100 |
commit | 3a1c738e6cf09d0972809fa431bf77dd564ff713 (patch) | |
tree | 85835dd31020158df43ad2830ecabf345b25a27c /Lib/test/test_asyncio/test_events.py | |
parent | 2338156fa4f8d6c04601f9972c36a7b06bd685bc (diff) | |
download | cpython-3a1c738e6cf09d0972809fa431bf77dd564ff713.tar.gz cpython-3a1c738e6cf09d0972809fa431bf77dd564ff713.zip |
Issue #23074: asyncio.get_event_loop() now raises an exception if the thread
has no event loop even if assertions are disabled.
Diffstat (limited to 'Lib/test/test_asyncio/test_events.py')
-rw-r--r-- | Lib/test/test_asyncio/test_events.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/test/test_asyncio/test_events.py b/Lib/test/test_asyncio/test_events.py index 6644fbeab63..d7e2f3488d5 100644 --- a/Lib/test/test_asyncio/test_events.py +++ b/Lib/test/test_asyncio/test_events.py @@ -2252,14 +2252,14 @@ class PolicyTests(unittest.TestCase): def test_get_event_loop_after_set_none(self): policy = asyncio.DefaultEventLoopPolicy() policy.set_event_loop(None) - self.assertRaises(AssertionError, policy.get_event_loop) + self.assertRaises(RuntimeError, policy.get_event_loop) @mock.patch('asyncio.events.threading.current_thread') def test_get_event_loop_thread(self, m_current_thread): def f(): policy = asyncio.DefaultEventLoopPolicy() - self.assertRaises(AssertionError, policy.get_event_loop) + self.assertRaises(RuntimeError, policy.get_event_loop) th = threading.Thread(target=f) th.start() |