summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_asyncio
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2023-10-04 09:19:08 (GMT)
committerGitHub <noreply@github.com>2023-10-04 09:19:08 (GMT)
commit1337765225d7d593169205672e004f97e15237ec (patch)
tree622172de25c5584a9407df73bc873b9dc5d13050 /Lib/test/test_asyncio
parent1de9406f9136e3952b849487f0151be3c669a3ea (diff)
downloadcpython-1337765225d7d593169205672e004f97e15237ec.zip
cpython-1337765225d7d593169205672e004f97e15237ec.tar.gz
cpython-1337765225d7d593169205672e004f97e15237ec.tar.bz2
gh-110335: asyncio test_unix_events cleans multiprocessing (#110336)
test_unix_events tests using the multiprocessing module now call multiprocessing.util._cleanup_tests().
Diffstat (limited to 'Lib/test/test_asyncio')
-rw-r--r--Lib/test/test_asyncio/test_unix_events.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/Lib/test/test_asyncio/test_unix_events.py b/Lib/test/test_asyncio/test_unix_events.py
index 7322be5..d2c8cba 100644
--- a/Lib/test/test_asyncio/test_unix_events.py
+++ b/Lib/test/test_asyncio/test_unix_events.py
@@ -4,6 +4,7 @@ import contextlib
import errno
import io
import multiprocessing
+from multiprocessing.util import _cleanup_tests as multiprocessing_cleanup_tests
import os
import pathlib
import signal
@@ -15,6 +16,7 @@ import time
import unittest
from unittest import mock
import warnings
+
from test import support
from test.support import os_helper
from test.support import socket_helper
@@ -1903,6 +1905,8 @@ class TestFork(unittest.IsolatedAsyncioTestCase):
@hashlib_helper.requires_hashdigest('md5')
def test_fork_signal_handling(self):
+ self.addCleanup(multiprocessing_cleanup_tests)
+
# Sending signal to the forked process should not affect the parent
# process
ctx = multiprocessing.get_context('fork')
@@ -1947,6 +1951,8 @@ class TestFork(unittest.IsolatedAsyncioTestCase):
@hashlib_helper.requires_hashdigest('md5')
def test_fork_asyncio_run(self):
+ self.addCleanup(multiprocessing_cleanup_tests)
+
ctx = multiprocessing.get_context('fork')
manager = ctx.Manager()
self.addCleanup(manager.shutdown)
@@ -1964,6 +1970,8 @@ class TestFork(unittest.IsolatedAsyncioTestCase):
@hashlib_helper.requires_hashdigest('md5')
def test_fork_asyncio_subprocess(self):
+ self.addCleanup(multiprocessing_cleanup_tests)
+
ctx = multiprocessing.get_context('fork')
manager = ctx.Manager()
self.addCleanup(manager.shutdown)