summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_import.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_import.py')
-rw-r--r--Lib/test/test_import.py14
1 files changed, 13 insertions, 1 deletions
diff --git a/Lib/test/test_import.py b/Lib/test/test_import.py
index 6eac67e..fe1da52 100644
--- a/Lib/test/test_import.py
+++ b/Lib/test/test_import.py
@@ -255,8 +255,20 @@ class PathsTests(unittest.TestCase):
self.assertEqual(mod.testdata, 'test_trailing_slash')
unload("test_trailing_slash")
+class RelativeImport(unittest.TestCase):
+ def tearDown(self):
+ try:
+ del sys.modules["test.relimport"]
+ except:
+ pass
+
+ def test_relimport_star(self):
+ # This will import * from .test_import.
+ from . import relimport
+ self.assertTrue(hasattr(relimport, "RelativeImport"))
+
def test_main(verbose=None):
- run_unittest(ImportTest, PathsTests)
+ run_unittest(ImportTest, PathsTests, RelativeImport)
if __name__ == '__main__':
test_main()