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_venv.py b/Lib/test/test_venv.py
index b2794cd..44c6219 100644
--- a/Lib/test/test_venv.py
+++ b/Lib/test/test_venv.py
@@ -530,7 +530,7 @@
# Issue #26610: pip/pep425tags.py requires ctypes
@unittest.skipUnless(ctypes, 'pip requires ctypes')
- @requires_zlib
+ @requires_zlib()
def test_with_pip(self):
self.do_test_with_pip(False)
self.do_test_with_pip(True)