]> granicus.if.org Git - python/commitdiff
(merge 3.2) Issue #12400: regrtest, force verbose mode to True with option -W
authorVictor Stinner <victor.stinner@haypocalc.com>
Wed, 29 Jun 2011 13:38:18 +0000 (15:38 +0200)
committerVictor Stinner <victor.stinner@haypocalc.com>
Wed, 29 Jun 2011 13:38:18 +0000 (15:38 +0200)
If verbose is False, the output is empty. Fix also a typo in a variable name.

1  2 
Lib/test/regrtest.py

index d64494ed8229532e5147047868baea9ca1a865d5,75d8795aff944c20274b6cc9904907acac57a30b..4d13fc76a3c2ff6898530867d988171bed197347
@@@ -834,17 -783,16 +834,19 @@@ def runtest(test, verbose, quiet
  
      if use_resources is not None:
          support.use_resources = use_resources
 +    use_timeout = (timeout is not None)
 +    if use_timeout:
 +        faulthandler.dump_tracebacks_later(timeout, exit=True)
      try:
-         support.verbose = verbose  # Tell tests to be moderately quiet
          if output_on_failure:
+             support.verbose = True
+             # Reuse the same instance to all calls to runtest(). Some
+             # tests keep a reference to sys.stdout or sys.stderr
+             # (eg. test_argparse).
              if runtest.stringio is None:
-                 # Reuse the same instance to all calls to runtest(). Some
-                 # tests keep a reference to sys.stdout or sys.stderr
-                 # (eg. test_argparse).
                  runtest.stringio = io.StringIO()
+             stream = runtest.stringio
  
              orig_stdout = sys.stdout
              orig_stderr = sys.stderr