]> granicus.if.org Git - python/commitdiff
Oops. I didn't expect that some tests (test_cookie) have expected
authorGuido van Rossum <guido@python.org>
Fri, 21 Sep 2001 20:45:44 +0000 (20:45 +0000)
committerGuido van Rossum <guido@python.org>
Fri, 21 Sep 2001 20:45:44 +0000 (20:45 +0000)
output *and* doctest stuff.  Assuming the doctest stuff comes after the
expected output, this fixes that.

Lib/test/regrtest.py
Lib/test/test_support.py

index a69fd4168de4e5eeeb7a08fc0f26d6011e704de8..c8c916760cae2abd4b74c37d2c9d05a2865f589d 100755 (executable)
@@ -287,7 +287,7 @@ def runtest(test, generate, verbose, quiet, testdir = None):
     else:
         cfp =  StringIO.StringIO()
     try:
-        save_stdout = sys.stdout
+        sys.save_stdout = sys.stdout
         try:
             if cfp:
                 sys.stdout = cfp
@@ -301,14 +301,7 @@ def runtest(test, generate, verbose, quiet, testdir = None):
             if indirect_test is not None:
                 indirect_test()
         finally:
-            sys.stdout = save_stdout
-            if cfp and test_support.output_comparison_denied():
-                output = cfp.getvalue()
-                cfp = None
-                s = test + "\n"
-                if output.startswith(s):
-                    output = output[len(s):]
-                sys.stdout.write(output)
+            sys.stdout = sys.save_stdout
     except (ImportError, test_support.TestSkipped), msg:
         if not quiet:
             print "test", test, "skipped --", msg
index 0a96f6656760f3a38b717cd8125560cd32c6397e..a9452fc904a01ed63217f64c5badcb5971404a1d 100644 (file)
@@ -32,6 +32,7 @@ _output_comparison = 1
 def deny_output_comparison():
     global _output_comparison
     _output_comparison = 0
+    sys.stdout = sys.save_stdout
 
 # regrtest's interface to _output_comparison.
 def output_comparison_denied():