diff --git a/tests/import/import_pkg7.py b/tests/import/import_pkg7.py new file mode 100644 index 0000000000..be8564ef66 --- /dev/null +++ b/tests/import/import_pkg7.py @@ -0,0 +1,2 @@ +# This tests ... relative imports as used in pkg7 +import pkg7.subpkg1.subpkg2.mod3 diff --git a/tests/import/pkg7/__init__.py b/tests/import/pkg7/__init__.py new file mode 100644 index 0000000000..8b92fa9967 --- /dev/null +++ b/tests/import/pkg7/__init__.py @@ -0,0 +1 @@ +print("pkg __name__:", __name__) diff --git a/tests/import/pkg7/mod1.py b/tests/import/pkg7/mod1.py new file mode 100644 index 0000000000..6b574114d1 --- /dev/null +++ b/tests/import/pkg7/mod1.py @@ -0,0 +1,2 @@ +print('mod1') +foo = 'mod1.foo' diff --git a/tests/import/pkg7/mod2.py b/tests/import/pkg7/mod2.py new file mode 100644 index 0000000000..039a5d1749 --- /dev/null +++ b/tests/import/pkg7/mod2.py @@ -0,0 +1,2 @@ +print('mod2') +bar = 'mod2.bar' diff --git a/tests/import/pkg7/subpkg1/__init__.py b/tests/import/pkg7/subpkg1/__init__.py new file mode 100644 index 0000000000..8b92fa9967 --- /dev/null +++ b/tests/import/pkg7/subpkg1/__init__.py @@ -0,0 +1 @@ +print("pkg __name__:", __name__) diff --git a/tests/import/pkg7/subpkg1/subpkg2/__init__.py b/tests/import/pkg7/subpkg1/subpkg2/__init__.py new file mode 100644 index 0000000000..8b92fa9967 --- /dev/null +++ b/tests/import/pkg7/subpkg1/subpkg2/__init__.py @@ -0,0 +1 @@ +print("pkg __name__:", __name__) diff --git a/tests/import/pkg7/subpkg1/subpkg2/mod3.py b/tests/import/pkg7/subpkg1/subpkg2/mod3.py new file mode 100644 index 0000000000..b85b34e604 --- /dev/null +++ b/tests/import/pkg7/subpkg1/subpkg2/mod3.py @@ -0,0 +1,4 @@ +from ... import mod1 +from ...mod2 import bar +print(mod1.foo) +print(bar)