mirror of
https://github.com/python/cpython.git
synced 2025-08-09 19:38:42 +00:00
gh-118761: Add test_lazy_import for more modules (#133057)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
This commit is contained in:
parent
b1aa515bd6
commit
cae660d6dc
20 changed files with 139 additions and 11 deletions
|
@ -23,6 +23,7 @@ from inspect import Signature
|
|||
|
||||
from test.support import import_helper
|
||||
from test.support import threading_helper
|
||||
from test.support import cpython_only
|
||||
from test.support import EqualToForwardRef
|
||||
|
||||
import functools
|
||||
|
@ -63,6 +64,14 @@ class BadTuple(tuple):
|
|||
class MyDict(dict):
|
||||
pass
|
||||
|
||||
class TestImportTime(unittest.TestCase):
|
||||
|
||||
@cpython_only
|
||||
def test_lazy_import(self):
|
||||
import_helper.ensure_lazy_imports(
|
||||
"functools", {"os", "weakref", "typing", "annotationlib", "warnings"}
|
||||
)
|
||||
|
||||
|
||||
class TestPartial:
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue