mirror of
https://github.com/python/cpython.git
synced 2025-08-31 14:07:50 +00:00
gh-130322: drop deprecation of asyncio.set_event_loop
(#132349)
This commit is contained in:
parent
e6ef47ac22
commit
05d27a84f4
16 changed files with 46 additions and 64 deletions
|
@ -68,7 +68,7 @@ class StreamTests(test_utils.TestCase):
|
|||
try:
|
||||
reader, writer = self.loop.run_until_complete(open_connection_fut)
|
||||
finally:
|
||||
asyncio._set_event_loop(None)
|
||||
asyncio.set_event_loop(None)
|
||||
writer.write(b'GET / HTTP/1.0\r\n\r\n')
|
||||
f = reader.read()
|
||||
data = self.loop.run_until_complete(f)
|
||||
|
@ -836,8 +836,8 @@ class StreamTests(test_utils.TestCase):
|
|||
# asyncio issue #184: Ensure that StreamReaderProtocol constructor
|
||||
# retrieves the current loop if the loop parameter is not set
|
||||
# Deprecated in 3.10, undeprecated in 3.12
|
||||
self.addCleanup(asyncio._set_event_loop, None)
|
||||
asyncio._set_event_loop(self.loop)
|
||||
self.addCleanup(asyncio.set_event_loop, None)
|
||||
asyncio.set_event_loop(self.loop)
|
||||
reader = asyncio.StreamReader()
|
||||
self.assertIs(reader._loop, self.loop)
|
||||
|
||||
|
@ -860,8 +860,8 @@ class StreamTests(test_utils.TestCase):
|
|||
# asyncio issue #184: Ensure that StreamReaderProtocol constructor
|
||||
# retrieves the current loop if the loop parameter is not set
|
||||
# Deprecated in 3.10, undeprecated in 3.12
|
||||
self.addCleanup(asyncio._set_event_loop, None)
|
||||
asyncio._set_event_loop(self.loop)
|
||||
self.addCleanup(asyncio.set_event_loop, None)
|
||||
asyncio.set_event_loop(self.loop)
|
||||
reader = mock.Mock()
|
||||
protocol = asyncio.StreamReaderProtocol(reader)
|
||||
self.assertIs(protocol._loop, self.loop)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue