bpo-40275: More lazy imports in test.support (GH-20131)
Make the the following imports lazy in test.support:
* bz2
* gzip
* lzma
* resource
* zlib
The following test.support decorators now need to be called
with parenthesis:
* @support.requires_bz2
* @support.requires_gzip
* @support.requires_lzma
* @support.requires_zlib
For example, "@requires_zlib" becomes "@requires_zlib()".
diff --git a/Lib/test/test_zipfile64.py b/Lib/test/test_zipfile64.py
index 56746bc..3a788de 100644
--- a/Lib/test/test_zipfile64.py
+++ b/Lib/test/test_zipfile64.py
@@ -73,7 +73,7 @@
self.assertFalse(f.closed)
self.zipTest(TESTFN2, zipfile.ZIP_STORED)
- @requires_zlib
+ @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.