summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_asyncio
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2023-09-12 01:31:15 (GMT)
committerGitHub <noreply@github.com>2023-09-12 01:31:15 (GMT)
commit09ea4b8706165fd9474165090a0ba86509abd6c8 (patch)
treecaea03849181960e389a324884093990bd0b825e /Lib/test/test_asyncio
parent391f3e3ca904449a50b2dd5956684357fdce690b (diff)
downloadcpython-09ea4b8706165fd9474165090a0ba86509abd6c8.zip
cpython-09ea4b8706165fd9474165090a0ba86509abd6c8.tar.gz
cpython-09ea4b8706165fd9474165090a0ba86509abd6c8.tar.bz2
gh-109295: Clean up multiprocessing in test_asyncio and test_compileall (#109298)
test_asyncio and test_compileall now clean up multiprocessing by calling multiprocessing _cleanup_tests(): explicitly clean up resources and stop background processes like the resource tracker.
Diffstat (limited to 'Lib/test/test_asyncio')
-rw-r--r--Lib/test/test_asyncio/test_events.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/Lib/test/test_asyncio/test_events.py b/Lib/test/test_asyncio/test_events.py
index 30cc8fd..1647d23 100644
--- a/Lib/test/test_asyncio/test_events.py
+++ b/Lib/test/test_asyncio/test_events.py
@@ -31,6 +31,7 @@ import asyncio
from asyncio import coroutines
from asyncio import events
from asyncio import selector_events
+from multiprocessing.util import _cleanup_tests as multiprocessing_cleanup_tests
from test.test_asyncio import utils as test_utils
from test import support
from test.support import socket_helper
@@ -2765,6 +2766,8 @@ class GetEventLoopTestsMixin:
# multiprocessing.synchronize module cannot be imported.
support.skip_if_broken_multiprocessing_synchronize()
+ self.addCleanup(multiprocessing_cleanup_tests)
+
async def main():
if multiprocessing.get_start_method() == 'fork':
# Avoid 'fork' DeprecationWarning.