aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Lib/test/test_asyncio/test_events.py
diff options
context:
space:
mode:
authorKumar Aditya <59607654+kumaraditya303@users.noreply.github.com>2022-10-16 04:39:30 +0530
committerGitHub <noreply@github.com>2022-10-15 16:09:30 -0700
commit660f10248ba321e7783c07f3801991275e2aee1e (patch)
tree7c1c2ba0839fc2e653117e1d26af7810f3e28cdc /Lib/test/test_asyncio/test_events.py
parentbb56dead336357153a0c3b8cc9d9d6856d2c5a03 (diff)
downloadcpython-660f10248ba321e7783c07f3801991275e2aee1e.tar.gz
cpython-660f10248ba321e7783c07f3801991275e2aee1e.zip
GH-94597: Deprecate child watcher getters and setters (#98215)
This is the next step for deprecating child watchers. Until we've removed the API completely we have to use it, so this PR is mostly suppressing a lot of warnings when using the API internally. Once the child watcher API is totally removed, the two child watcher implementations we actually use and need (Pidfd and Thread) will be turned into internal helpers.
Diffstat (limited to 'Lib/test/test_asyncio/test_events.py')
-rw-r--r--Lib/test/test_asyncio/test_events.py16
1 files changed, 10 insertions, 6 deletions
diff --git a/Lib/test/test_asyncio/test_events.py b/Lib/test/test_asyncio/test_events.py
index 98b55dec37f..cabe75f56d9 100644
--- a/Lib/test/test_asyncio/test_events.py
+++ b/Lib/test/test_asyncio/test_events.py
@@ -2058,11 +2058,13 @@ else:
with warnings.catch_warnings():
warnings.simplefilter('ignore', DeprecationWarning)
watcher = asyncio.SafeChildWatcher()
- watcher.attach_loop(self.loop)
- asyncio.set_child_watcher(watcher)
+ watcher.attach_loop(self.loop)
+ asyncio.set_child_watcher(watcher)
def tearDown(self):
- asyncio.set_child_watcher(None)
+ with warnings.catch_warnings():
+ warnings.simplefilter('ignore', DeprecationWarning)
+ asyncio.set_child_watcher(None)
super().tearDown()
@@ -2657,13 +2659,15 @@ class GetEventLoopTestsMixin:
with warnings.catch_warnings():
warnings.simplefilter('ignore', DeprecationWarning)
watcher = asyncio.SafeChildWatcher()
- watcher.attach_loop(self.loop)
- asyncio.set_child_watcher(watcher)
+ watcher.attach_loop(self.loop)
+ asyncio.set_child_watcher(watcher)
def tearDown(self):
try:
if sys.platform != 'win32':
- asyncio.set_child_watcher(None)
+ with warnings.catch_warnings():
+ warnings.simplefilter('ignore', DeprecationWarning)
+ asyncio.set_child_watcher(None)
super().tearDown()
finally: