summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_pkg.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_pkg.py')
-rw-r--r--Lib/test/test_pkg.py27
1 files changed, 27 insertions, 0 deletions
diff --git a/Lib/test/test_pkg.py b/Lib/test/test_pkg.py
index fd22612..a99da35 100644
--- a/Lib/test/test_pkg.py
+++ b/Lib/test/test_pkg.py
@@ -165,6 +165,33 @@ from t6 import *
print dir(t6)
print dir()
"""),
+
+ ("t7", [
+ ("t7.py", "print 'Importing t7.py'"),
+ ("t7", None),
+ ("t7 __init__.py", "print __name__, 'loading'"),
+ ("t7 sub.py", "print 'THIS SHOULD NOT BE PRINTED (sub.py)'"),
+ ("t7 sub", None),
+ ("t7 sub __init__.py", ""),
+ ("t7 sub subsub.py", "print 'THIS SHOULD NOT BE PRINTED (subsub.py)'"),
+ ("t7 sub subsub", None),
+ ("t7 sub subsub __init__.py", "print __name__, 'loading'; spam = 1"),
+ ],
+"""
+t7, sub, subsub = None, None, None
+import t7 as tas
+print dir(tas)
+assert not t7
+from t7 import sub as subpar
+print dir(subpar)
+assert not t7 and not sub
+from t7.sub import subsub as subsubsub
+print dir(subsubsub)
+assert not t7 and not sub and not subsub
+from t7.sub.subsub import spam as ham
+print "t7.sub.subsub.spam =", ham
+assert not t7 and not sub and not subsub
+"""),
]