summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_pkg.py
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1998-05-19 15:09:42 (GMT)
committerGuido van Rossum <guido@python.org>1998-05-19 15:09:42 (GMT)
commit5f4fb913a2418df5da78675b552400013605f91d (patch)
tree676445f08262f1406648ada58f1c67d70c9d9eec /Lib/test/test_pkg.py
parent9c0afe5dc71bb072f7aa471b572799fabda52e40 (diff)
downloadcpython-5f4fb913a2418df5da78675b552400013605f91d.zip
cpython-5f4fb913a2418df5da78675b552400013605f91d.tar.gz
cpython-5f4fb913a2418df5da78675b552400013605f91d.tar.bz2
Test that "import sys.imp" fails as it should.
Diffstat (limited to 'Lib/test/test_pkg.py')
-rw-r--r--Lib/test/test_pkg.py13
1 files changed, 12 insertions, 1 deletions
diff --git a/Lib/test/test_pkg.py b/Lib/test/test_pkg.py
index aa0d3f0..fd22612 100644
--- a/Lib/test/test_pkg.py
+++ b/Lib/test/test_pkg.py
@@ -3,7 +3,7 @@
import sys, os, string, tempfile, traceback
from os import mkdir, rmdir # Can't test if these fail
del mkdir, rmdir
-from test_support import verbose
+from test_support import verbose, TestFailed
# Helpers to create and destroy hierarchies.
@@ -212,3 +212,14 @@ for name, hier, code in tests:
continue
print "running test", name
runtest(hier, code)
+
+# Test
+import sys
+import imp
+try:
+ import sys.imp
+except ImportError:
+ # This is what we expect
+ pass
+else:
+ raise TestFailed, "No ImportError exception on 'import sys.imp'"