Skip to content

Commit 1d87465

Browse files
[3.12] gh-110335: asyncio test_unix_events cleans multiprocessing (GH-110336) (#110338)
gh-110335: asyncio test_unix_events cleans multiprocessing (GH-110336) test_unix_events tests using the multiprocessing module now call multiprocessing.util._cleanup_tests(). (cherry picked from commit 1337765) Co-authored-by: Victor Stinner <vstinner@python.org>
1 parent 8939221 commit 1d87465

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

Lib/test/test_asyncio/test_unix_events.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import errno
55
import io
66
import multiprocessing
7+
from multiprocessing.util import _cleanup_tests as multiprocessing_cleanup_tests
78
import os
89
import pathlib
910
import signal
@@ -15,6 +16,7 @@
1516
import unittest
1617
from unittest import mock
1718
import warnings
19+
1820
from test import support
1921
from test.support import os_helper
2022
from test.support import socket_helper
@@ -1903,6 +1905,8 @@ async def test_fork_not_share_event_loop(self):
19031905

19041906
@hashlib_helper.requires_hashdigest('md5')
19051907
def test_fork_signal_handling(self):
1908+
self.addCleanup(multiprocessing_cleanup_tests)
1909+
19061910
# Sending signal to the forked process should not affect the parent
19071911
# process
19081912
ctx = multiprocessing.get_context('fork')
@@ -1947,6 +1951,8 @@ async def func():
19471951

19481952
@hashlib_helper.requires_hashdigest('md5')
19491953
def test_fork_asyncio_run(self):
1954+
self.addCleanup(multiprocessing_cleanup_tests)
1955+
19501956
ctx = multiprocessing.get_context('fork')
19511957
manager = ctx.Manager()
19521958
self.addCleanup(manager.shutdown)
@@ -1964,6 +1970,8 @@ async def child_main():
19641970

19651971
@hashlib_helper.requires_hashdigest('md5')
19661972
def test_fork_asyncio_subprocess(self):
1973+
self.addCleanup(multiprocessing_cleanup_tests)
1974+
19671975
ctx = multiprocessing.get_context('fork')
19681976
manager = ctx.Manager()
19691977
self.addCleanup(manager.shutdown)

0 commit comments

Comments
 (0)