summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_modulefinder.py
diff options
context:
space:
mode:
authorThomas Heller <theller@ctypes.org>2008-10-30 20:29:54 (GMT)
committerThomas Heller <theller@ctypes.org>2008-10-30 20:29:54 (GMT)
commit68daeb0f8575bd4acb7c7b0e2d0bfee4c6c961b2 (patch)
tree1363426ee10d4044d83bc5669e0ef91aee93cca9 /Lib/test/test_modulefinder.py
parentb74777ed333ce2d22494fd4c996e87d386d950c8 (diff)
downloadcpython-68daeb0f8575bd4acb7c7b0e2d0bfee4c6c961b2.zip
cpython-68daeb0f8575bd4acb7c7b0e2d0bfee4c6c961b2.tar.gz
cpython-68daeb0f8575bd4acb7c7b0e2d0bfee4c6c961b2.tar.bz2
Merged revisions 67046 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r67046 | thomas.heller | 2008-10-30 21:18:13 +0100 (Do, 30 Okt 2008) | 2 lines Fixed a modulefinder crash on certain relative imports. ........
Diffstat (limited to 'Lib/test/test_modulefinder.py')
-rw-r--r--Lib/test/test_modulefinder.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/Lib/test/test_modulefinder.py b/Lib/test/test_modulefinder.py
index b62758a..9d7f76a 100644
--- a/Lib/test/test_modulefinder.py
+++ b/Lib/test/test_modulefinder.py
@@ -190,6 +190,19 @@ a/b/c/e.py
a/b/c/f.py
"""]
+relative_import_test_3 = [
+ "a.module",
+ ["a", "a.module"],
+ ["a.bar"],
+ [],
+ """\
+a/__init__.py
+ def foo(): pass
+a/module.py
+ from . import foo
+ from . import bar
+"""]
+
def open_file(path):
##print "#", os.path.abspath(path)
dirname = os.path.dirname(path)
@@ -256,6 +269,9 @@ class ModuleFinderTest(unittest.TestCase):
def test_relative_imports_2(self):
self._do_test(relative_import_test_2)
+ def test_relative_imports_3(self):
+ self._do_test(relative_import_test_3)
+
def test_main():
distutils.log.set_threshold(distutils.log.WARN)
test_support.run_unittest(ModuleFinderTest)