aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Lib/test/test_asyncio/test_unix_events.py
diff options
context:
space:
mode:
authorKumar Aditya <59607654+kumaraditya303@users.noreply.github.com>2022-10-09 02:22:19 +0530
committerGitHub <noreply@github.com>2022-10-08 13:52:19 -0700
commitd8765284f33ec221b5fe07b439ca2dc2d648251d (patch)
treea0535fa12e331f73f9a1759581cafb05e75d37f3 /Lib/test/test_asyncio/test_unix_events.py
parent75751f4aa5d70f65856645a9128fd42d92d6692c (diff)
downloadcpython-d8765284f33ec221b5fe07b439ca2dc2d648251d.tar.gz
cpython-d8765284f33ec221b5fe07b439ca2dc2d648251d.zip
GH-94597: deprecate `SafeChildWatcher`, `FastChildWatcher` and `MultiLoopChildWatcher` child watchers (#98089)
Diffstat (limited to 'Lib/test/test_asyncio/test_unix_events.py')
-rw-r--r--Lib/test/test_asyncio/test_unix_events.py21
1 files changed, 16 insertions, 5 deletions
diff --git a/Lib/test/test_asyncio/test_unix_events.py b/Lib/test/test_asyncio/test_unix_events.py
index 03fb5e649d8..025da0f20ed 100644
--- a/Lib/test/test_asyncio/test_unix_events.py
+++ b/Lib/test/test_asyncio/test_unix_events.py
@@ -12,6 +12,7 @@ import sys
import threading
import unittest
from unittest import mock
+import warnings
from test.support import os_helper
from test.support import socket_helper
@@ -1686,12 +1687,16 @@ class ChildWatcherTestsMixin:
class SafeChildWatcherTests (ChildWatcherTestsMixin, test_utils.TestCase):
def create_watcher(self):
- return asyncio.SafeChildWatcher()
+ with warnings.catch_warnings():
+ warnings.simplefilter("ignore", DeprecationWarning)
+ return asyncio.SafeChildWatcher()
class FastChildWatcherTests (ChildWatcherTestsMixin, test_utils.TestCase):
def create_watcher(self):
- return asyncio.FastChildWatcher()
+ with warnings.catch_warnings():
+ warnings.simplefilter("ignore", DeprecationWarning)
+ return asyncio.FastChildWatcher()
class PolicyTests(unittest.TestCase):
@@ -1724,7 +1729,9 @@ class PolicyTests(unittest.TestCase):
def test_get_child_watcher_after_set(self):
policy = self.create_policy()
- watcher = asyncio.FastChildWatcher()
+ with warnings.catch_warnings():
+ warnings.simplefilter("ignore", DeprecationWarning)
+ watcher = asyncio.FastChildWatcher()
policy.set_child_watcher(watcher)
self.assertIs(policy._watcher, watcher)
@@ -1745,7 +1752,9 @@ class PolicyTests(unittest.TestCase):
policy.get_event_loop().close()
policy = self.create_policy()
- policy.set_child_watcher(asyncio.SafeChildWatcher())
+ with warnings.catch_warnings():
+ warnings.simplefilter("ignore", DeprecationWarning)
+ policy.set_child_watcher(asyncio.SafeChildWatcher())
th = threading.Thread(target=f)
th.start()
@@ -1757,7 +1766,9 @@ class PolicyTests(unittest.TestCase):
# Explicitly setup SafeChildWatcher,
# default ThreadedChildWatcher has no _loop property
- watcher = asyncio.SafeChildWatcher()
+ with warnings.catch_warnings():
+ warnings.simplefilter("ignore", DeprecationWarning)
+ watcher = asyncio.SafeChildWatcher()
policy.set_child_watcher(watcher)
watcher.attach_loop(loop)