GH-120804: Remove SafeChildWatcher, FastChildWatcher and MultiLoopChildWatcher from asyncio (#120805)

Remove SafeChildWatcher, FastChildWatcher and MultiLoopChildWatcher from asyncio. These child watchers have been deprecated since Python 3.12. The tests are also removed and some more tests will be added after the rewrite of child watchers.
This commit is contained in:
Kumar Aditya 2024-06-21 10:23:10 +05:30 committed by GitHub
parent a2f6f7dd26
commit 733dac01b0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 4 additions and 1041 deletions

View file

@ -631,15 +631,6 @@ class SubprocessMixin:
# the transport was not notified yet
self.assertFalse(killed)
# Unlike SafeChildWatcher, FastChildWatcher does not pop the
# callbacks if waitpid() is called elsewhere. Let's clear them
# manually to avoid a warning when the watcher is detached.
if (sys.platform != 'win32' and
isinstance(self, SubprocessFastWatcherTests)):
with warnings.catch_warnings():
warnings.simplefilter('ignore', DeprecationWarning)
asyncio.get_child_watcher()._callbacks.clear()
async def _test_popen_error(self, stdin):
if sys.platform == 'win32':
target = 'asyncio.windows_utils.Popen'
@ -908,26 +899,6 @@ if sys.platform != 'win32':
def _get_watcher(self):
return unix_events.ThreadedChildWatcher()
class SubprocessSafeWatcherTests(SubprocessWatcherMixin,
test_utils.TestCase):
def _get_watcher(self):
with self.assertWarns(DeprecationWarning):
return unix_events.SafeChildWatcher()
class MultiLoopChildWatcherTests(test_utils.TestCase):
def test_warns(self):
with self.assertWarns(DeprecationWarning):
unix_events.MultiLoopChildWatcher()
class SubprocessFastWatcherTests(SubprocessWatcherMixin,
test_utils.TestCase):
def _get_watcher(self):
with self.assertWarns(DeprecationWarning):
return unix_events.FastChildWatcher()
@unittest.skipUnless(
unix_events.can_use_pidfd(),
"operating system does not support pidfds",