summaryrefslogtreecommitdiff
path: root/subdir/modules_with_same_names_but_different_symbols
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2013-10-06 17:26:09 +0100
committerLars Wirzenius <liw@liw.fi>2013-10-06 17:26:09 +0100
commit1470c3296f6a28c3dd95c786552702af5a241682 (patch)
tree9b21554c8a78a3c9c11449bd5064266033f1302a /subdir/modules_with_same_names_but_different_symbols
parentd7b5706244fca58d8a2564ba6394cb460d2ca2c6 (diff)
parent0a3b1a065257109295f9322f5a7e199d157acfe6 (diff)
downloadpython-coverage-test-runner-1470c3296f6a28c3dd95c786552702af5a241682.tar.gz
Fix importing of modules with the same basename
By Jannis Pohlmann
Diffstat (limited to 'subdir/modules_with_same_names_but_different_symbols')
-rw-r--r--subdir/modules_with_same_names_but_different_symbols/__init__.py2
-rw-r--r--subdir/modules_with_same_names_but_different_symbols/module1/__init__.py1
-rw-r--r--subdir/modules_with_same_names_but_different_symbols/module1/duplicate.py4
-rw-r--r--subdir/modules_with_same_names_but_different_symbols/module1/duplicate_tests.py11
-rw-r--r--subdir/modules_with_same_names_but_different_symbols/module2/__init__.py1
-rw-r--r--subdir/modules_with_same_names_but_different_symbols/module2/duplicate.py4
-rw-r--r--subdir/modules_with_same_names_but_different_symbols/module2/duplicate_tests.py11
7 files changed, 34 insertions, 0 deletions
diff --git a/subdir/modules_with_same_names_but_different_symbols/__init__.py b/subdir/modules_with_same_names_but_different_symbols/__init__.py
new file mode 100644
index 0000000..909cf90
--- /dev/null
+++ b/subdir/modules_with_same_names_but_different_symbols/__init__.py
@@ -0,0 +1,2 @@
+import module1
+import module2
diff --git a/subdir/modules_with_same_names_but_different_symbols/module1/__init__.py b/subdir/modules_with_same_names_but_different_symbols/module1/__init__.py
new file mode 100644
index 0000000..e1dd07e
--- /dev/null
+++ b/subdir/modules_with_same_names_but_different_symbols/module1/__init__.py
@@ -0,0 +1 @@
+import duplicate
diff --git a/subdir/modules_with_same_names_but_different_symbols/module1/duplicate.py b/subdir/modules_with_same_names_but_different_symbols/module1/duplicate.py
new file mode 100644
index 0000000..02aa6a1
--- /dev/null
+++ b/subdir/modules_with_same_names_but_different_symbols/module1/duplicate.py
@@ -0,0 +1,4 @@
+class DuplicateClass(object):
+
+ def a_function(self):
+ return True
diff --git a/subdir/modules_with_same_names_but_different_symbols/module1/duplicate_tests.py b/subdir/modules_with_same_names_but_different_symbols/module1/duplicate_tests.py
new file mode 100644
index 0000000..232c510
--- /dev/null
+++ b/subdir/modules_with_same_names_but_different_symbols/module1/duplicate_tests.py
@@ -0,0 +1,11 @@
+import unittest
+
+from subdir.modules_with_same_names_but_different_symbols.module1 \
+ import duplicate
+
+
+class DuplicateClassTests(unittest.TestCase):
+
+ def test_a_function_works(self):
+ o = duplicate.DuplicateClass()
+ self.assertEqual(o.a_function(), True)
diff --git a/subdir/modules_with_same_names_but_different_symbols/module2/__init__.py b/subdir/modules_with_same_names_but_different_symbols/module2/__init__.py
new file mode 100644
index 0000000..e1dd07e
--- /dev/null
+++ b/subdir/modules_with_same_names_but_different_symbols/module2/__init__.py
@@ -0,0 +1 @@
+import duplicate
diff --git a/subdir/modules_with_same_names_but_different_symbols/module2/duplicate.py b/subdir/modules_with_same_names_but_different_symbols/module2/duplicate.py
new file mode 100644
index 0000000..75ea503
--- /dev/null
+++ b/subdir/modules_with_same_names_but_different_symbols/module2/duplicate.py
@@ -0,0 +1,4 @@
+class DifferentClass(object):
+
+ def a_function(self):
+ return True
diff --git a/subdir/modules_with_same_names_but_different_symbols/module2/duplicate_tests.py b/subdir/modules_with_same_names_but_different_symbols/module2/duplicate_tests.py
new file mode 100644
index 0000000..dd3abf4
--- /dev/null
+++ b/subdir/modules_with_same_names_but_different_symbols/module2/duplicate_tests.py
@@ -0,0 +1,11 @@
+import unittest
+
+from subdir.modules_with_same_names_but_different_symbols.module2 \
+ import duplicate
+
+
+class DifferentClassTests(unittest.TestCase):
+
+ def test_a_function_works(self):
+ o = duplicate.DifferentClass()
+ self.assertEqual(o.a_function(), True)