mirror of
https://github.com/python/cpython.git
synced 2025-09-26 10:19:53 +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
|
@ -11,6 +11,9 @@ import re
|
|||
import types
|
||||
import unittest
|
||||
|
||||
from test.support import cpython_only
|
||||
from test.support.import_helper import ensure_lazy_imports
|
||||
|
||||
# list, tuple and dict subclasses that do or don't overwrite __repr__
|
||||
class list2(list):
|
||||
pass
|
||||
|
@ -129,6 +132,10 @@ class QueryTestCase(unittest.TestCase):
|
|||
self.b = list(range(200))
|
||||
self.a[-12] = self.b
|
||||
|
||||
@cpython_only
|
||||
def test_lazy_import(self):
|
||||
ensure_lazy_imports("pprint", {"dataclasses", "re"})
|
||||
|
||||
def test_init(self):
|
||||
pp = pprint.PrettyPrinter()
|
||||
pp = pprint.PrettyPrinter(indent=4, width=40, depth=5,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue