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
|
@ -14,8 +14,9 @@ import unittest
|
|||
|
||||
from io import StringIO
|
||||
from test import support
|
||||
from test.support import os_helper
|
||||
from test.support import cpython_only, os_helper
|
||||
from test.support.i18n_helper import TestTranslationsBase, update_translation_snapshots
|
||||
from test.support.import_helper import ensure_lazy_imports
|
||||
|
||||
import optparse
|
||||
from optparse import make_option, Option, \
|
||||
|
@ -1655,6 +1656,10 @@ class MiscTestCase(unittest.TestCase):
|
|||
not_exported = {'check_builtin', 'AmbiguousOptionError', 'NO_DEFAULT'}
|
||||
support.check__all__(self, optparse, not_exported=not_exported)
|
||||
|
||||
@cpython_only
|
||||
def test_lazy_import(self):
|
||||
ensure_lazy_imports("optparse", {"textwrap"})
|
||||
|
||||
|
||||
class TestTranslations(TestTranslationsBase):
|
||||
def test_translations(self):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue