aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Lib/test/regrtest.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/regrtest.py')
-rwxr-xr-xLib/test/regrtest.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/Lib/test/regrtest.py b/Lib/test/regrtest.py
index 2c09f63fdf4..16d51ea913a 100755
--- a/Lib/test/regrtest.py
+++ b/Lib/test/regrtest.py
@@ -288,7 +288,7 @@ def runtest(test, generate, verbose, quiet, testdir = None):
elif verbose:
cfp = sys.stdout
else:
- cfp = Compare(outputfile)
+ cfp = Compare(outputfile, sys.stdout)
except IOError:
cfp = None
print "Warning: can't open", outputfile
@@ -386,7 +386,8 @@ def printlist(x, width=70, indent=4):
print line
class Compare:
- def __init__(self, filename):
+ def __init__(self, filename, origstdout):
+ self.origstdout = origstdout
if os.path.exists(filename):
self.fp = open(filename, 'r')
else:
@@ -395,6 +396,9 @@ class Compare:
self.stuffthatmatched = []
def write(self, data):
+ if test_support.suppress_output_comparison():
+ self.origstdout.write(data)
+ return
expected = self.fp.read(len(data))
if data == expected:
self.stuffthatmatched.append(expected)