diff options
| author | Ezio Melotti <ezio.melotti@gmail.com> | 2009-09-12 14:43:43 (GMT) |
|---|---|---|
| committer | Ezio Melotti <ezio.melotti@gmail.com> | 2009-09-12 14:43:43 (GMT) |
| commit | 1036a7f7e180ac3fd98e43832a04e38b4c7c9e83 (patch) | |
| tree | eab29c294a6bbc075d44281c91d7ae433f3c96d0 /Lib/distutils/tests/test_sdist.py | |
| parent | 21121e64b4245e51b85b9d2bc9b29acb86ae79eb (diff) | |
| download | cpython-1036a7f7e180ac3fd98e43832a04e38b4c7c9e83.zip cpython-1036a7f7e180ac3fd98e43832a04e38b4c7c9e83.tar.gz cpython-1036a7f7e180ac3fd98e43832a04e38b4c7c9e83.tar.bz2 | |
#6026 - fix tests that failed without zlib
Diffstat (limited to 'Lib/distutils/tests/test_sdist.py')
| -rw-r--r-- | Lib/distutils/tests/test_sdist.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/Lib/distutils/tests/test_sdist.py b/Lib/distutils/tests/test_sdist.py index 5808ca1..c2feccb 100644 --- a/Lib/distutils/tests/test_sdist.py +++ b/Lib/distutils/tests/test_sdist.py @@ -3,6 +3,14 @@ import os import unittest import shutil import zipfile + +# zlib is not used here, but if it's not available +# the tests that use zipfile may fail +try: + import zlib +except ImportError: + zlib = None + from os.path import join import sys import tempfile @@ -79,6 +87,7 @@ class SDistTestCase(PyPIRCCommandTestCase): cmd.warn = _warn return dist, cmd + @unittest.skipUnless(zlib, "requires zlib") 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 @@ -120,6 +129,7 @@ class SDistTestCase(PyPIRCCommandTestCase): # making sure everything has been pruned correctly self.assertEquals(len(content), 4) + @unittest.skipUnless(zlib, "requires zlib") def test_make_distribution(self): # check if tar and gzip are installed @@ -156,6 +166,7 @@ class SDistTestCase(PyPIRCCommandTestCase): self.assertEquals(result, ['fake-1.0.tar', 'fake-1.0.tar.gz']) + @unittest.skipUnless(zlib, "requires zlib") def test_add_defaults(self): # http://bugs.python.org/issue2279 @@ -217,6 +228,7 @@ class SDistTestCase(PyPIRCCommandTestCase): manifest = open(join(self.tmp_dir, 'MANIFEST')).read() self.assertEquals(manifest, MANIFEST % {'sep': os.sep}) + @unittest.skipUnless(zlib, "requires zlib") def test_metadata_check_option(self): # testing the `medata-check` option dist, cmd = self.get_cmd(metadata={}) |
