bpo-40275: Use new test.support helper submodules in tests (GH-20849)

This commit is contained in:
Hai Shi 2020-06-25 18:38:51 +08:00 committed by GitHub
parent 5f190d2cc6
commit f7ba40b505
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
17 changed files with 78 additions and 60 deletions

View file

@ -20,6 +20,7 @@ from test.libregrtest.setup import setup_tests
from test.libregrtest.pgo import setup_pgo_tests
from test.libregrtest.utils import removepy, count, format_duration, printlist
from test import support
from test.support import os_helper
# bpo-38203: Maximum delay in seconds to exit Python (call Py_Finalize()).
@ -628,7 +629,7 @@ class Regrtest:
# to a temporary and writable directory. If it's not possible to
# create or change the CWD, the original CWD will be used.
# The original CWD is available from support.SAVEDCWD.
with support.temp_cwd(test_cwd, quiet=True):
with os_helper.temp_cwd(test_cwd, quiet=True):
# When using multiprocessing, worker processes will use test_cwd
# as their parent temporary directory. So when the main process
# exit, it removes also subdirectories of worker processes.