mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
bpo-40275: Use new test.support helper submodules in tests (GH-21314)
This commit is contained in:
parent
9ce8132e1f
commit
883bc63833
19 changed files with 225 additions and 194 deletions
|
@ -23,6 +23,7 @@ except ImportError:
|
|||
_have_multiprocessing = False
|
||||
|
||||
from test import support
|
||||
from test.support import os_helper
|
||||
from test.support import script_helper
|
||||
|
||||
from .test_py_compile import without_source_date_epoch
|
||||
|
@ -356,7 +357,7 @@ class CompileallTestsBase:
|
|||
except Exception:
|
||||
pass
|
||||
|
||||
@support.skip_unless_symlink
|
||||
@os_helper.skip_unless_symlink
|
||||
def test_ignore_symlink_destination(self):
|
||||
# Create folders for allowed files, symlinks and prohibited area
|
||||
allowed_path = os.path.join(self.directory, "test", "dir", "allowed")
|
||||
|
@ -438,7 +439,7 @@ class CommandLineTestsBase:
|
|||
sys_path_writable = False
|
||||
break
|
||||
finally:
|
||||
support.unlink(str(path))
|
||||
os_helper.unlink(str(path))
|
||||
if directory_created:
|
||||
directory.rmdir()
|
||||
else:
|
||||
|
@ -477,7 +478,7 @@ class CommandLineTestsBase:
|
|||
|
||||
def setUp(self):
|
||||
self.directory = tempfile.mkdtemp()
|
||||
self.addCleanup(support.rmtree, self.directory)
|
||||
self.addCleanup(os_helper.rmtree, self.directory)
|
||||
self.pkgdir = os.path.join(self.directory, 'foo')
|
||||
os.mkdir(self.pkgdir)
|
||||
self.pkgdir_cachedir = os.path.join(self.pkgdir, '__pycache__')
|
||||
|
@ -625,7 +626,7 @@ class CommandLineTestsBase:
|
|||
self.assertCompiled(spamfn)
|
||||
self.assertCompiled(eggfn)
|
||||
|
||||
@support.skip_unless_symlink
|
||||
@os_helper.skip_unless_symlink
|
||||
def test_symlink_loop(self):
|
||||
# Currently, compileall ignores symlinks to directories.
|
||||
# If that limitation is ever lifted, it should protect against
|
||||
|
@ -823,7 +824,7 @@ class CommandLineTestsBase:
|
|||
except Exception:
|
||||
pass
|
||||
|
||||
@support.skip_unless_symlink
|
||||
@os_helper.skip_unless_symlink
|
||||
def test_ignore_symlink_destination(self):
|
||||
# Create folders for allowed files, symlinks and prohibited area
|
||||
allowed_path = os.path.join(self.directory, "test", "dir", "allowed")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue