summaryrefslogtreecommitdiff
path: root/Lib/distutils/tests/test_sdist.py
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2011-03-15 21:02:59 +0100
committerAntoine Pitrou <solipsis@pitrou.net>2011-03-15 21:02:59 +0100
commit2c50a09ac47e701768a4e20f8a03d17263e8db8f (patch)
treec825f5ed587fe4229ec825f3371556738e284dd2 /Lib/distutils/tests/test_sdist.py
parent7dedcb46441803444a3bdb0f9773d9d9b10186e9 (diff)
downloadcpython-git-2c50a09ac47e701768a4e20f8a03d17263e8db8f.tar.gz
On behalf of Tarek: Issue #11501: disutils.archive_utils.make_zipfile no
longer fails if zlib is not installed. Instead, the zipfile.ZIP_STORED compression is used to create the ZipFile. Patch by Natalia B. Bidart.
Diffstat (limited to 'Lib/distutils/tests/test_sdist.py')
-rw-r--r--Lib/distutils/tests/test_sdist.py15
1 files changed, 14 insertions, 1 deletions
diff --git a/Lib/distutils/tests/test_sdist.py b/Lib/distutils/tests/test_sdist.py
index 655e50dcfc..eaf39a45ba 100644
--- a/Lib/distutils/tests/test_sdist.py
+++ b/Lib/distutils/tests/test_sdist.py
@@ -40,6 +40,13 @@ somecode%(sep)sdoc.dat
somecode%(sep)sdoc.txt
"""
+try:
+ import zlib
+ ZLIB_SUPPORT = True
+except ImportError:
+ ZLIB_SUPPORT = False
+
+
class SDistTestCase(PyPIRCCommandTestCase):
def setUp(self):
@@ -78,6 +85,7 @@ class SDistTestCase(PyPIRCCommandTestCase):
cmd.warn = _warn
return dist, cmd
+ @unittest.skipUnless(ZLIB_SUPPORT, 'Need zlib support to run')
def test_prune_file_list(self):
# this test creates a package with some vcs dirs in it
# and launch sdist to make sure they get pruned
@@ -119,6 +127,7 @@ class SDistTestCase(PyPIRCCommandTestCase):
# making sure everything has been pruned correctly
self.assertEqual(len(content), 4)
+ @unittest.skipUnless(ZLIB_SUPPORT, 'Need zlib support to run')
def test_make_distribution(self):
# check if tar and gzip are installed
@@ -153,6 +162,7 @@ class SDistTestCase(PyPIRCCommandTestCase):
result.sort()
self.assertEqual(result, ['fake-1.0.tar', 'fake-1.0.tar.gz'])
+ @unittest.skipUnless(ZLIB_SUPPORT, 'Need zlib support to run')
def test_add_defaults(self):
# http://bugs.python.org/issue2279
@@ -218,6 +228,7 @@ class SDistTestCase(PyPIRCCommandTestCase):
finally:
f.close()
+ @unittest.skipUnless(ZLIB_SUPPORT, 'Need zlib support to run')
def test_metadata_check_option(self):
# testing the `medata-check` option
dist, cmd = self.get_cmd(metadata={})
@@ -277,7 +288,7 @@ class SDistTestCase(PyPIRCCommandTestCase):
cmd.formats = 'supazipa'
self.assertRaises(DistutilsOptionError, cmd.finalize_options)
-
+ @unittest.skipUnless(ZLIB_SUPPORT, 'Need zlib support to run')
def test_get_file_list(self):
# make sure MANIFEST is recalculated
dist, cmd = self.get_cmd()
@@ -318,6 +329,7 @@ class SDistTestCase(PyPIRCCommandTestCase):
self.assertEqual(len(manifest2), 6)
self.assertIn('doc2.txt', manifest2[-1])
+ @unittest.skipUnless(ZLIB_SUPPORT, 'Need zlib support to run')
def test_manifest_marker(self):
# check that autogenerated MANIFESTs have a marker
dist, cmd = self.get_cmd()
@@ -334,6 +346,7 @@ class SDistTestCase(PyPIRCCommandTestCase):
self.assertEqual(manifest[0],
'# file GENERATED by distutils, do NOT edit')
+ @unittest.skipUnless(ZLIB_SUPPORT, 'Need zlib support to run')
def test_manual_manifest(self):
# check that a MANIFEST without a marker is left alone
dist, cmd = self.get_cmd()