[Python-checkins] CVS: python/dist/src/Lib/test test_import.py,1.2,1.3

Tim Peters tim_one@users.sourceforge.net
2001年3月20日 19:58:18 -0800


Update of /cvsroot/python/python/dist/src/Lib/test
In directory usw-pr-cvs1:/tmp/cvs-serv23256/python/dist/src/Lib/test
Modified Files:
	test_import.py 
Log Message:
Addrf simple test that import is case-sensitive.
Index: test_import.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_import.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** test_import.py	2000年10月24日 17:16:32	1.2
--- test_import.py	2001年03月21日 03:58:16	1.3
***************
*** 1,7 ****
! from test_support import TESTFN
 
 import os
 import random
 import sys
 
 sys.path.insert(0, os.curdir)
--- 1,16 ----
! from test_support import TESTFN, TestFailed
 
 import os
 import random
 import sys
+ 
+ # Brief digression to test that import is case-sensitive: if we got this
+ # far, we know for sure that "random" exists.
+ try:
+ import RAnDoM
+ except ImportError:
+ pass
+ else:
+ raise TestFailed("import of RAnDoM should have failed (case mismatch)")
 
 sys.path.insert(0, os.curdir)

AltStyle によって変換されたページ (->オリジナル) /