OLD | NEW |
1 import sys | 1 import sys |
2 import os | 2 import os |
3 import marshal | 3 import marshal |
4 import imp | 4 import imp |
5 import struct | 5 import struct |
6 import time | 6 import time |
7 import unittest | 7 import unittest |
8 | 8 |
9 import zlib # implied prerequisite | |
10 from zipfile import ZipFile, ZipInfo, ZIP_STORED, ZIP_DEFLATED | |
11 from test import test_support | 9 from test import test_support |
12 from test.test_importhooks import ImportHooksBaseTestCase, test_src, test_co | 10 from test.test_importhooks import ImportHooksBaseTestCase, test_src, test_co |
13 | 11 |
| 12 zlib = test_support.import_module('zlib') # implied prerequisite |
| 13 from zipfile import ZipFile, ZipInfo, ZIP_STORED, ZIP_DEFLATED |
| 14 |
14 import zipimport | 15 import zipimport |
15 import linecache | 16 import linecache |
16 import doctest | 17 import doctest |
17 import inspect | 18 import inspect |
18 import StringIO | 19 import StringIO |
19 from traceback import extract_tb, extract_stack, print_tb | 20 from traceback import extract_tb, extract_stack, print_tb |
20 raise_src = 'def do_raise(): raise TypeError\n' | 21 raise_src = 'def do_raise(): raise TypeError\n' |
21 | 22 |
22 # so we only run testAFakeZlib once if this test is run repeatedly | 23 # so we only run testAFakeZlib once if this test is run repeatedly |
23 # which happens when we look for ref leaks | 24 # which happens when we look for ref leaks |
(...skipping 449 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
473 test_support.run_unittest( | 474 test_support.run_unittest( |
474 UncompressedZipImportTestCase, | 475 UncompressedZipImportTestCase, |
475 CompressedZipImportTestCase, | 476 CompressedZipImportTestCase, |
476 BadFileZipImportTestCase, | 477 BadFileZipImportTestCase, |
477 ) | 478 ) |
478 finally: | 479 finally: |
479 test_support.unlink(TESTMOD) | 480 test_support.unlink(TESTMOD) |
480 | 481 |
481 if __name__ == "__main__": | 482 if __name__ == "__main__": |
482 test_main() | 483 test_main() |
OLD | NEW |