diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2015-01-15 13:17:34 +0100 |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2015-01-15 13:17:34 +0100 |
commit | 33cb0396e86841aa3af033071aa8a00abbdba4d4 (patch) | |
tree | 797cd23b68055b5df248d6c335e7d86c21cf4cf5 /Lib/test/test_asyncio/test_proactor_events.py | |
parent | 41ed958ee6f0ff15836e11013d1cada8c3ae90fc (diff) | |
download | cpython-33cb0396e86841aa3af033071aa8a00abbdba4d4.tar.gz cpython-33cb0396e86841aa3af033071aa8a00abbdba4d4.zip |
Issue #23243: Close explicitly event loops in asyncio tests
Diffstat (limited to 'Lib/test/test_asyncio/test_proactor_events.py')
-rw-r--r-- | Lib/test/test_asyncio/test_proactor_events.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Lib/test/test_asyncio/test_proactor_events.py b/Lib/test/test_asyncio/test_proactor_events.py index 825823834ae..08c622a836d 100644 --- a/Lib/test/test_asyncio/test_proactor_events.py +++ b/Lib/test/test_asyncio/test_proactor_events.py @@ -16,6 +16,7 @@ class ProactorSocketTransportTests(test_utils.TestCase): def setUp(self): self.loop = self.new_test_loop() + self.addCleanup(self.loop.close) self.proactor = mock.Mock() self.loop._proactor = self.proactor self.protocol = test_utils.make_test_protocol(asyncio.Protocol) @@ -459,6 +460,9 @@ class BaseProactorEventLoopTests(test_utils.TestCase): self.assertIsNone(self.loop._ssock) self.assertIsNone(self.loop._csock) + # Don't call close(): _close_self_pipe() cannot be called twice + self.loop._closed = True + def test_close(self): self.loop._close_self_pipe = mock.Mock() self.loop.close() |