summaryrefslogtreecommitdiffstats
path: root/Lib/test/support
diff options
context:
space:
mode:
authorHai Shi <shihai1992@gmail.com>2020-08-08 09:32:41 (GMT)
committerGitHub <noreply@github.com>2020-08-08 09:32:41 (GMT)
commitd94af3f7ed98e6bfb4bf5f918f464b5e23d3ed1b (patch)
treefcd219f3484eca8caade4aaa68a1d5fd66218e3c /Lib/test/support
parenta4084b9d1e40c1c9259372263d1fe8c8a562b093 (diff)
downloadcpython-d94af3f7ed98e6bfb4bf5f918f464b5e23d3ed1b.zip
cpython-d94af3f7ed98e6bfb4bf5f918f464b5e23d3ed1b.tar.gz
cpython-d94af3f7ed98e6bfb4bf5f918f464b5e23d3ed1b.tar.bz2
bpo-40275: Remove test helpers aliases in test.support (GH-21771)
Diffstat (limited to 'Lib/test/support')
-rw-r--r--Lib/test/support/__init__.py23
1 files changed, 4 insertions, 19 deletions
diff --git a/Lib/test/support/__init__.py b/Lib/test/support/__init__.py
index b517df7..e9573d1 100644
--- a/Lib/test/support/__init__.py
+++ b/Lib/test/support/__init__.py
@@ -14,25 +14,6 @@ import time
import types
import unittest
-from .import_helper import (
- CleanImport, DirsOnSysPath, _ignore_deprecated_imports,
- _save_and_block_module, _save_and_remove_module,
- forget, import_fresh_module, import_module, make_legacy_pyc,
- modules_cleanup, modules_setup, unload)
-from .os_helper import (
- FS_NONASCII, SAVEDCWD, TESTFN, TESTFN_ASCII, TESTFN_NONASCII,
- TESTFN_UNENCODABLE, TESTFN_UNDECODABLE,
- TESTFN_UNICODE, can_symlink, can_xattr,
- change_cwd, create_empty_file, fd_count,
- fs_is_case_insensitive, make_bad_fd, rmdir,
- rmtree, skip_unless_symlink, skip_unless_xattr,
- temp_cwd, temp_dir, temp_umask, unlink,
- EnvironmentVarGuard, FakePath, _longpath)
-from .warnings_helper import (
- WarningsRecorder, _filterwarnings,
- check_no_resource_warning, check_no_warnings,
- check_syntax_warning, check_warnings, ignore_warnings)
-
from .testresult import get_test_runner
@@ -506,6 +487,7 @@ def check_syntax_error(testcase, statement, errtext='', *, lineno=None, offset=N
def open_urlresource(url, *args, **kw):
import urllib.request, urllib.parse
+ from .os_helper import unlink
try:
import gzip
except ImportError:
@@ -1326,6 +1308,8 @@ def skip_if_buggy_ucrt_strfptime(test):
class PythonSymlink:
"""Creates a symlink for the current Python executable"""
def __init__(self, link=None):
+ from .os_helper import TESTFN
+
self.link = link or os.path.abspath(TESTFN)
self._linked = []
self.real = os.path.realpath(sys.executable)
@@ -1980,6 +1964,7 @@ def skip_if_broken_multiprocessing_synchronize():
is no available semaphore implementation, or if creating a lock raises an
OSError (on Linux only).
"""
+ from .import_helper import import_module
# Skip tests if the _multiprocessing extension is missing.
import_module('_multiprocessing')