aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Lib/test
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/namespace_pkgs/module_and_file/a_test.py1
-rw-r--r--Lib/test/namespace_pkgs/module_and_file/a_test/empty0
-rw-r--r--Lib/test/test_namespace_pkgs.py8
3 files changed, 9 insertions, 0 deletions
diff --git a/Lib/test/namespace_pkgs/module_and_file/a_test.py b/Lib/test/namespace_pkgs/module_and_file/a_test.py
new file mode 100644
index 00000000000..43cbedbbdb7
--- /dev/null
+++ b/Lib/test/namespace_pkgs/module_and_file/a_test.py
@@ -0,0 +1 @@
+attr = 'in module'
diff --git a/Lib/test/namespace_pkgs/module_and_file/a_test/empty b/Lib/test/namespace_pkgs/module_and_file/a_test/empty
new file mode 100644
index 00000000000..e69de29bb2d
--- /dev/null
+++ b/Lib/test/namespace_pkgs/module_and_file/a_test/empty
diff --git a/Lib/test/test_namespace_pkgs.py b/Lib/test/test_namespace_pkgs.py
index 02b55281cf0..7ad511fae7f 100644
--- a/Lib/test/test_namespace_pkgs.py
+++ b/Lib/test/test_namespace_pkgs.py
@@ -276,6 +276,14 @@ class ZipWithMissingDirectory(NamespacePackageTest):
self.assertEqual(bar.two.attr, 'missing_directory foo two')
+class ModuleAndFileInSameDir(NamespacePackageTest):
+ paths = ['module_and_file']
+
+ def test_module_before_namespace_package(self):
+ import a_test
+ self.assertEqual(a_test.attr, 'in module')
+
+
def test_main():
run_unittest(*NamespacePackageTest.__subclasses__())