tests/import: Add a test which uses ... in from-import statement.
This commit is contained in:
parent
9af73bda33
commit
67f3edc10a
2
tests/import/import_pkg7.py
Normal file
2
tests/import/import_pkg7.py
Normal file
@ -0,0 +1,2 @@
|
||||
# This tests ... relative imports as used in pkg7
|
||||
import pkg7.subpkg1.subpkg2.mod3
|
1
tests/import/pkg7/__init__.py
Normal file
1
tests/import/pkg7/__init__.py
Normal file
@ -0,0 +1 @@
|
||||
print("pkg __name__:", __name__)
|
2
tests/import/pkg7/mod1.py
Normal file
2
tests/import/pkg7/mod1.py
Normal file
@ -0,0 +1,2 @@
|
||||
print('mod1')
|
||||
foo = 'mod1.foo'
|
2
tests/import/pkg7/mod2.py
Normal file
2
tests/import/pkg7/mod2.py
Normal file
@ -0,0 +1,2 @@
|
||||
print('mod2')
|
||||
bar = 'mod2.bar'
|
1
tests/import/pkg7/subpkg1/__init__.py
Normal file
1
tests/import/pkg7/subpkg1/__init__.py
Normal file
@ -0,0 +1 @@
|
||||
print("pkg __name__:", __name__)
|
1
tests/import/pkg7/subpkg1/subpkg2/__init__.py
Normal file
1
tests/import/pkg7/subpkg1/subpkg2/__init__.py
Normal file
@ -0,0 +1 @@
|
||||
print("pkg __name__:", __name__)
|
4
tests/import/pkg7/subpkg1/subpkg2/mod3.py
Normal file
4
tests/import/pkg7/subpkg1/subpkg2/mod3.py
Normal file
@ -0,0 +1,4 @@
|
||||
from ... import mod1
|
||||
from ...mod2 import bar
|
||||
print(mod1.foo)
|
||||
print(bar)
|
Loading…
Reference in New Issue
Block a user