From: Fred Drake Date: Mon, 21 May 2001 21:08:12 +0000 (+0000) Subject: If the file containing expected output does not exist, assume that it X-Git-Tag: v2.2a3~1722 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ae1bb176bea47b2123bba208733edb42692e9431;p=thirdparty%2FPython%2Fcpython.git 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. --- diff --git a/Lib/test/regrtest.py b/Lib/test/regrtest.py index ffa67f1b41fd..c77abc34a303 100755 --- a/Lib/test/regrtest.py +++ b/Lib/test/regrtest.py @@ -37,6 +37,7 @@ import os import getopt import traceback import random +import StringIO import test_support @@ -284,7 +285,11 @@ def count(n, word): class Compare: def __init__(self, filename): - self.fp = open(filename, 'r') + if os.path.exists(filename): + self.fp = open(filename, 'r') + else: + self.fp = StringIO.StringIO( + os.path.basename(filename) + "\n") self.stuffthatmatched = [] def write(self, data):