diff options
author | Hai Shi <shihai1992@gmail.com> | 2020-07-06 12:29:49 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-06 12:29:49 (GMT) |
commit | deb016224cc506503fb05e821a60158c83918ed4 (patch) | |
tree | 21b683e93134e016806477e15df1211567441301 /Lib/distutils/tests/test_filelist.py | |
parent | b4a9263708cc67c98c4d53b16933f6e5dd07990f (diff) | |
download | cpython-deb016224cc506503fb05e821a60158c83918ed4.zip cpython-deb016224cc506503fb05e821a60158c83918ed4.tar.gz cpython-deb016224cc506503fb05e821a60158c83918ed4.tar.bz2 |
bpo-40275: Use new test.support helper submodules in tests (GH-21317)
Diffstat (limited to 'Lib/distutils/tests/test_filelist.py')
-rw-r--r-- | Lib/distutils/tests/test_filelist.py | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/Lib/distutils/tests/test_filelist.py b/Lib/distutils/tests/test_filelist.py index 2c26c22..cee97d4 100644 --- a/Lib/distutils/tests/test_filelist.py +++ b/Lib/distutils/tests/test_filelist.py @@ -8,7 +8,6 @@ from distutils.errors import DistutilsTemplateError from distutils.filelist import glob_to_re, translate_pattern, FileList from distutils import filelist -import test.support from test.support import os_helper from test.support import captured_stdout, run_unittest from distutils.tests import support @@ -298,7 +297,7 @@ class FileListTestCase(support.LoggingSilencer, class FindAllTestCase(unittest.TestCase): @os_helper.skip_unless_symlink def test_missing_symlink(self): - with test.support.temp_cwd(): + with os_helper.temp_cwd(): os.symlink('foo', 'bar') self.assertEqual(filelist.findall(), []) @@ -308,13 +307,13 @@ class FindAllTestCase(unittest.TestCase): '.' as the parameter, the dot should be omitted from the results. """ - with test.support.temp_cwd(): + with os_helper.temp_cwd(): os.mkdir('foo') file1 = os.path.join('foo', 'file1.txt') - test.support.create_empty_file(file1) + os_helper.create_empty_file(file1) os.mkdir('bar') file2 = os.path.join('bar', 'file2.txt') - test.support.create_empty_file(file2) + os_helper.create_empty_file(file2) expected = [file2, file1] self.assertEqual(sorted(filelist.findall()), expected) @@ -323,9 +322,9 @@ class FindAllTestCase(unittest.TestCase): When findall is called with another path, the full path name should be returned. """ - with test.support.temp_dir() as temp_dir: + with os_helper.temp_dir() as temp_dir: file1 = os.path.join(temp_dir, 'file1.txt') - test.support.create_empty_file(file1) + os_helper.create_empty_file(file1) expected = [file1] self.assertEqual(filelist.findall(temp_dir), expected) |