Skip to content

Commit 67f3edc

Browse files
committed
tests/import: Add a test which uses ... in from-import statement.
1 parent 9af73bd commit 67f3edc

7 files changed

Lines changed: 13 additions & 0 deletions

File tree

tests/import/import_pkg7.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# This tests ... relative imports as used in pkg7
2+
import pkg7.subpkg1.subpkg2.mod3

tests/import/pkg7/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
print("pkg __name__:", __name__)

tests/import/pkg7/mod1.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
print('mod1')
2+
foo = 'mod1.foo'

tests/import/pkg7/mod2.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
print('mod2')
2+
bar = 'mod2.bar'
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
print("pkg __name__:", __name__)
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
print("pkg __name__:", __name__)
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
from ... import mod1
2+
from ...mod2 import bar
3+
print(mod1.foo)
4+
print(bar)

0 commit comments

Comments
 (0)