mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +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
|
@ -19,7 +19,8 @@ from io import StringIO
|
|||
from pickle import dumps, loads, PicklingError, HIGHEST_PROTOCOL
|
||||
from test import support
|
||||
from test.support import ALWAYS_EQ, REPO_ROOT
|
||||
from test.support import threading_helper
|
||||
from test.support import threading_helper, cpython_only
|
||||
from test.support.import_helper import ensure_lazy_imports
|
||||
from datetime import timedelta
|
||||
|
||||
python_version = sys.version_info[:2]
|
||||
|
@ -5288,6 +5289,10 @@ class MiscTestCase(unittest.TestCase):
|
|||
def test__all__(self):
|
||||
support.check__all__(self, enum, not_exported={'bin', 'show_flag_values'})
|
||||
|
||||
@cpython_only
|
||||
def test_lazy_import(self):
|
||||
ensure_lazy_imports("enum", {"functools", "warnings", "inspect", "re"})
|
||||
|
||||
def test_doc_1(self):
|
||||
class Single(Enum):
|
||||
ONE = 1
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue