mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
Test that "import sys.imp" fails as it should.
This commit is contained in:
parent
9c0afe5dc7
commit
5f4fb913a2
1 changed files with 12 additions and 1 deletions
|
@ -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'"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue