aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Lib/test/test_asyncio/test_streams.py
diff options
context:
space:
mode:
authorKumar Aditya <kumaraditya@python.org>2024-12-24 19:24:28 +0530
committerGitHub <noreply@github.com>2024-12-24 19:24:28 +0530
commit9fce90682553e2cfe93e98e2ae5948bf9c7c4456 (patch)
tree68349cd7bec642cadc1bb7436d1f0c54ccb91366 /Lib/test/test_asyncio/test_streams.py
parent3ddd70ceaaf67b111ee4251817e150396d6d10a9 (diff)
downloadcpython-9fce90682553e2cfe93e98e2ae5948bf9c7c4456.tar.gz
cpython-9fce90682553e2cfe93e98e2ae5948bf9c7c4456.zip
gh-127949: deprecate `asyncio.set_event_loop` (#128218)
Deprecate `asyncio.set_event_loop` to be removed in Python 3.16.
Diffstat (limited to 'Lib/test/test_asyncio/test_streams.py')
-rw-r--r--Lib/test/test_asyncio/test_streams.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/Lib/test/test_asyncio/test_streams.py b/Lib/test/test_asyncio/test_streams.py
index c3ba90b309e..047ada8c5d2 100644
--- a/Lib/test/test_asyncio/test_streams.py
+++ b/Lib/test/test_asyncio/test_streams.py
@@ -71,7 +71,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)
@@ -839,8 +839,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)
@@ -863,8 +863,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)