mirror of
https://github.com/python/cpython.git
synced 2025-10-26 19:24:34 +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
|
|
@ -16,6 +16,7 @@
|
|||
from urllib.request import pathname2url
|
||||
|
||||
from test.support import import_helper
|
||||
from test.support import cpython_only
|
||||
from test.support import is_emscripten, is_wasi
|
||||
from test.support import infinite_recursion
|
||||
from test.support import os_helper
|
||||
|
|
@ -80,6 +81,12 @@ def test_is_notimplemented(self):
|
|||
self.assertTrue(isinstance(pathlib.UnsupportedOperation(), NotImplementedError))
|
||||
|
||||
|
||||
class LazyImportTest(unittest.TestCase):
|
||||
@cpython_only
|
||||
def test_lazy_import(self):
|
||||
import_helper.ensure_lazy_imports("pathlib", {"shutil"})
|
||||
|
||||
|
||||
#
|
||||
# Tests for the pure classes.
|
||||
#
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue