diff --git a/tests/import/import_pkg7.py b/tests/import/import_pkg7.py new file mode 100644 index 0000000000000000000000000000000000000000..be8564ef66884ce4ad1cf92b42dc99e35f7f007f --- /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 0000000000000000000000000000000000000000..8b92fa9967ac4d8b116130f9bc873e4b51f46203 --- /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 0000000000000000000000000000000000000000..6b574114d18632a145141c1325e232f875b636cf --- /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 0000000000000000000000000000000000000000..039a5d174995b21d86958dbe200f233d6a61d7eb --- /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 0000000000000000000000000000000000000000..8b92fa9967ac4d8b116130f9bc873e4b51f46203 --- /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 0000000000000000000000000000000000000000..8b92fa9967ac4d8b116130f9bc873e4b51f46203 --- /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 0000000000000000000000000000000000000000..b85b34e60433e4fe9373a57e16606ea5bc85d25f --- /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)