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_logging.py b/Lib/test/test_logging.py
index 4cc45f7..9a11445 100644
--- a/Lib/test/test_logging.py
+++ b/Lib/test/test_logging.py
@@ -5076,7 +5076,7 @@
self.assertFalse(os.path.exists(rh.namer(self.fn + ".1")))
rh.close()
- @support.requires_zlib
+ @support.requires_zlib()
def test_rotator(self):
def namer(name):
return name + ".gz"