diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2016-12-16 19:04:17 +0200 |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2016-12-16 19:04:17 +0200 |
commit | 30ad6e2c460754d3943c6cc568b75aa842565446 (patch) | |
tree | 31211a61e48a727c04a0718278cb5a4b2aa15393 /Lib/test/test_shutil.py | |
parent | 6560e22c6664b720077643a338c71578baba6b58 (diff) | |
download | cpython-git-30ad6e2c460754d3943c6cc568b75aa842565446.tar.gz |
Issue #14061: Misc fixes and cleanups in archiving code in shutil.
Improved the documentation and tests for make_archive().
Improved error handling when corresponding compress module is not available.
External zip executable is now used if the zlib module is not available.
Diffstat (limited to 'Lib/test/test_shutil.py')
-rw-r--r-- | Lib/test/test_shutil.py | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/Lib/test/test_shutil.py b/Lib/test/test_shutil.py index 0869a9e553..8338712da2 100644 --- a/Lib/test/test_shutil.py +++ b/Lib/test/test_shutil.py @@ -35,6 +35,7 @@ except ImportError: try: import zipfile + import zlib ZIP_SUPPORT = True except ImportError: ZIP_SUPPORT = find_executable('zip') @@ -460,7 +461,6 @@ class TestShutil(unittest.TestCase): self.assertEqual(tarball, base_name + '.tar') self.assertTrue(os.path.isfile(tarball)) - @unittest.skipUnless(zlib, "Requires zlib") @unittest.skipUnless(ZIP_SUPPORT, 'Need zip support to run') def test_make_zipfile(self): # creating something to zip @@ -485,6 +485,7 @@ class TestShutil(unittest.TestCase): ['dist/', 'dist/file1', 'dist/file2', 'dist/sub/', 'dist/sub/file3', 'dist/sub2/', 'outer']) + support.unlink(res) with support.change_cwd(work_dir): base_name = os.path.abspath(rel_base_name) @@ -498,7 +499,6 @@ class TestShutil(unittest.TestCase): ['dist/', 'dist/file1', 'dist/file2', 'dist/sub/', 'dist/sub/file3', 'dist/sub2/']) - @unittest.skipUnless(zlib, "Requires zlib") @unittest.skipUnless(ZIP_SUPPORT, 'Need zip support to run') @unittest.skipUnless(find_executable('zip'), 'Need the zip command to run') @@ -524,7 +524,6 @@ class TestShutil(unittest.TestCase): names2 = zf.namelist() self.assertEqual(sorted(names), sorted(names2)) - @unittest.skipUnless(zlib, "Requires zlib") @unittest.skipUnless(ZIP_SUPPORT, 'Need zip support to run') @unittest.skipUnless(find_executable('unzip'), 'Need the unzip command to run') |