mirror of https://github.com/python/cpython
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.
This commit is contained in:
parent
6268669612
commit
ae1bb176be
|
@ -37,6 +37,7 @@ import os
|
||||||
import getopt
|
import getopt
|
||||||
import traceback
|
import traceback
|
||||||
import random
|
import random
|
||||||
|
import StringIO
|
||||||
|
|
||||||
import test_support
|
import test_support
|
||||||
|
|
||||||
|
@ -284,7 +285,11 @@ def count(n, word):
|
||||||
class Compare:
|
class Compare:
|
||||||
|
|
||||||
def __init__(self, filename):
|
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 = []
|
self.stuffthatmatched = []
|
||||||
|
|
||||||
def write(self, data):
|
def write(self, data):
|
||||||
|
|
Loading…
Reference in New Issue