mirror of
https://github.com/python/cpython.git
synced 2025-07-23 03:05:38 +00:00
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()".
This commit is contained in:
parent
ced4e5c227
commit
a3ec3ad9e2
10 changed files with 81 additions and 77 deletions
|
@ -10,7 +10,7 @@ from importlib.resources import path
|
|||
from test.support import requires_zlib
|
||||
|
||||
|
||||
@requires_zlib
|
||||
@requires_zlib()
|
||||
class TestZip(unittest.TestCase):
|
||||
root = 'test.test_importlib.data'
|
||||
|
||||
|
@ -50,7 +50,7 @@ class TestZip(unittest.TestCase):
|
|||
assert '.whl/' in path, path
|
||||
|
||||
|
||||
@requires_zlib
|
||||
@requires_zlib()
|
||||
class TestEgg(TestZip):
|
||||
def setUp(self):
|
||||
# Find the path to the example-*.egg so we can add it to the front of
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue