mirror of
https://github.com/python/cpython.git
synced 2025-08-30 21:48:47 +00:00
Issue #23243: Close explicitly event loops in asyncio tests
This commit is contained in:
parent
41ed958ee6
commit
33cb0396e8
3 changed files with 20 additions and 1 deletions
|
@ -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()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue