mirror of
https://github.com/python/cpython.git
synced 2025-08-31 05:58:33 +00:00
Refactor a few tests to use the new requires_zlib decorator.
This commit is contained in:
parent
cad648cbc9
commit
975077a889
5 changed files with 49 additions and 79 deletions
|
@ -9,12 +9,6 @@ import unittest
|
|||
from test import support
|
||||
from test.test_importhooks import ImportHooksBaseTestCase, test_src, test_co
|
||||
|
||||
# some tests can be ran even without zlib
|
||||
try:
|
||||
import zlib
|
||||
except ImportError:
|
||||
zlib = None
|
||||
|
||||
from zipfile import ZipFile, ZipInfo, ZIP_STORED, ZIP_DEFLATED
|
||||
|
||||
import zipimport
|
||||
|
@ -397,7 +391,7 @@ class UncompressedZipImportTestCase(ImportHooksBaseTestCase):
|
|||
os.remove(filename)
|
||||
|
||||
|
||||
@unittest.skipUnless(zlib, "requires zlib")
|
||||
@support.requires_zlib
|
||||
class CompressedZipImportTestCase(UncompressedZipImportTestCase):
|
||||
compression = ZIP_DEFLATED
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue