[Python-checkins] CVS: python/dist/src/Lib/test regrtest.py,1.33,1.34

Fred L. Drake fdrake@users.sourceforge.net
2001年5月21日 14:08:14 -0700


Update of /cvsroot/python/python/dist/src/Lib/test
In directory usw-pr-cvs1:/tmp/cvs-serv18703
Modified Files:
	regrtest.py 
Log Message:
If the file containing expected output does not exist, assume that it
contains a single line of text giving the name of the output file. This
covers all tests that do not actually produce any output in the test code.
Index: regrtest.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/regrtest.py,v
retrieving revision 1.33
retrieving revision 1.34
diff -C2 -r1.33 -r1.34
*** regrtest.py	2001年04月18日 01:19:27	1.33
--- regrtest.py	2001年05月21日 21:08:12	1.34
***************
*** 38,41 ****
--- 38,42 ----
 import traceback
 import random
+ import StringIO
 
 import test_support
***************
*** 285,289 ****
 
 def __init__(self, filename):
! self.fp = open(filename, 'r')
 self.stuffthatmatched = []
 
--- 286,294 ----
 
 def __init__(self, filename):
! if os.path.exists(filename):
! self.fp = open(filename, 'r')
! else:
! self.fp = StringIO.StringIO(
! os.path.basename(filename) + "\n")
 self.stuffthatmatched = []
 

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