|
14 | 14 | import types |
15 | 15 | import unittest |
16 | 16 |
|
17 | | -from .import_helper import ( |
18 | | - CleanImport, DirsOnSysPath, _ignore_deprecated_imports, |
19 | | - _save_and_block_module, _save_and_remove_module, |
20 | | - forget, import_fresh_module, import_module, make_legacy_pyc, |
21 | | - modules_cleanup, modules_setup, unload) |
22 | | -from .os_helper import ( |
23 | | - FS_NONASCII, SAVEDCWD, TESTFN, TESTFN_ASCII, TESTFN_NONASCII, |
24 | | - TESTFN_UNENCODABLE, TESTFN_UNDECODABLE, |
25 | | - TESTFN_UNICODE, can_symlink, can_xattr, |
26 | | - change_cwd, create_empty_file, fd_count, |
27 | | - fs_is_case_insensitive, make_bad_fd, rmdir, |
28 | | - rmtree, skip_unless_symlink, skip_unless_xattr, |
29 | | - temp_cwd, temp_dir, temp_umask, unlink, |
30 | | - EnvironmentVarGuard, FakePath, _longpath) |
31 | | -from .warnings_helper import ( |
32 | | - WarningsRecorder, _filterwarnings, |
33 | | - check_no_resource_warning, check_no_warnings, |
34 | | - check_syntax_warning, check_warnings, ignore_warnings) |
35 | | - |
36 | 17 | from .testresult import get_test_runner |
37 | 18 |
|
38 | 19 |
|
@@ -506,6 +487,7 @@ def check_syntax_error(testcase, statement, errtext='', *, lineno=None, offset=N |
506 | 487 |
|
507 | 488 | def open_urlresource(url, *args, **kw): |
508 | 489 | import urllib.request, urllib.parse |
| 490 | + from .os_helper import unlink |
509 | 491 | try: |
510 | 492 | import gzip |
511 | 493 | except ImportError: |
@@ -1326,6 +1308,8 @@ def skip_if_buggy_ucrt_strfptime(test): |
1326 | 1308 | class PythonSymlink: |
1327 | 1309 | """Creates a symlink for the current Python executable""" |
1328 | 1310 | def __init__(self, link=None): |
| 1311 | + from .os_helper import TESTFN |
| 1312 | + |
1329 | 1313 | self.link = link or os.path.abspath(TESTFN) |
1330 | 1314 | self._linked = [] |
1331 | 1315 | self.real = os.path.realpath(sys.executable) |
@@ -1980,6 +1964,7 @@ def skip_if_broken_multiprocessing_synchronize(): |
1980 | 1964 | is no available semaphore implementation, or if creating a lock raises an |
1981 | 1965 | OSError (on Linux only). |
1982 | 1966 | """ |
| 1967 | + from .import_helper import import_module |
1983 | 1968 |
|
1984 | 1969 | # Skip tests if the _multiprocessing extension is missing. |
1985 | 1970 | import_module('_multiprocessing') |
|
0 commit comments