diff options
author | Ezio Melotti <ezio.melotti@gmail.com> | 2011-05-19 19:03:22 (GMT) |
---|---|---|
committer | Ezio Melotti <ezio.melotti@gmail.com> | 2011-05-19 19:03:22 (GMT) |
commit | 975077a88912d723c7c3277f5abc8b7497f63e2a (patch) | |
tree | ebef00678b6062c140aded82e8539ec0656aa10c /Lib/test/test_zipfile64.py | |
parent | cad648cbc95db0a5d694bd73a6a4ba2505920066 (diff) | |
download | cpython-975077a88912d723c7c3277f5abc8b7497f63e2a.zip cpython-975077a88912d723c7c3277f5abc8b7497f63e2a.tar.gz cpython-975077a88912d723c7c3277f5abc8b7497f63e2a.tar.bz2 |
Refactor a few tests to use the new requires_zlib decorator.
Diffstat (limited to 'Lib/test/test_zipfile64.py')
-rw-r--r-- | Lib/test/test_zipfile64.py | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/Lib/test/test_zipfile64.py b/Lib/test/test_zipfile64.py index 0e7d73f..a8fb7ab 100644 --- a/Lib/test/test_zipfile64.py +++ b/Lib/test/test_zipfile64.py @@ -11,12 +11,6 @@ support.requires( 'test requires loads of disk-space bytes and a long time to run' ) -# We can test part of the module without zlib. -try: - import zlib -except ImportError: - zlib = None - import zipfile, os, unittest import time import sys @@ -24,7 +18,7 @@ import sys from io import StringIO from tempfile import TemporaryFile -from test.support import TESTFN, run_unittest +from test.support import TESTFN, run_unittest, requires_zlib TESTFN2 = TESTFN + "2" @@ -81,12 +75,12 @@ class TestsWithSourceFile(unittest.TestCase): for f in TemporaryFile(), TESTFN2: self.zipTest(f, zipfile.ZIP_STORED) - if zlib: - def testDeflated(self): - # Try the temp file first. If we do TESTFN2 first, then it hogs - # gigabytes of disk space for the duration of the test. - for f in TemporaryFile(), TESTFN2: - self.zipTest(f, zipfile.ZIP_DEFLATED) + @requires_zlib + def testDeflated(self): + # Try the temp file first. If we do TESTFN2 first, then it hogs + # gigabytes of disk space for the duration of the test. + for f in TemporaryFile(), TESTFN2: + self.zipTest(f, zipfile.ZIP_DEFLATED) def tearDown(self): for fname in TESTFN, TESTFN2: |