Skip to content

Commit e33c76c

Browse files
committed
Add test case for lazy import dotted.name as name
1 parent 452231c commit e33c76c

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

Lib/test/test_lazy_import/__init__.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -706,6 +706,14 @@ def test_non_package_lazily_imported(self):
706706
""")
707707
assert_python_ok("-c", code)
708708

709+
def test_non_package_lazily_imported_as(self):
710+
"""Doing a dotted lazy import as still works"""
711+
code = textwrap.dedent("""
712+
lazy import math.pi as pi
713+
pi
714+
""")
715+
assert_python_ok("-c", code)
716+
709717
def test_missing_attribute_raises_import_error(self):
710718
"""Accessing a nonexistent lazy name via from import raises ImportError."""
711719
code = textwrap.dedent("""

0 commit comments

Comments
 (0)