]> granicus.if.org Git - python/commitdiff
regrtest: always show before/after of modified env (#1407) (#1409)
authorVictor Stinner <victor.stinner@gmail.com>
Wed, 3 May 2017 01:47:44 +0000 (03:47 +0200)
committerGitHub <noreply@github.com>
Wed, 3 May 2017 01:47:44 +0000 (03:47 +0200)
Buildbots don't run tests with -vv and so only log "xxx was modified
by test_xxx" which is not enough to debug such random issue. In many
cases, I'm unable to reproduce the warning and so unable to fix it.

Always logging the value before and value after should help to debug
such warning on buildbots.
(cherry picked from commit ec4b17239d899550be4ee6104b61751bb3c70382)
(cherry picked from commit 22982350235f8c5821b71661a5616423e1c7fcc0)

Lib/test/regrtest.py

index 5702e38f457c6f311716f39d0845a609a535cc1b..bc3fa713b50f52a9662f1f0c804373da7bf663bc 100755 (executable)
@@ -901,10 +901,9 @@ class saved_test_environment:
                     print >>sys.stderr, (
                           "Warning -- {} was modified by {}".format(
                                                  name, self.testname))
-                    if self.verbose > 1 and not self.pgo:
-                        print >>sys.stderr, (
-                              "  Before: {}\n  After:  {} ".format(
-                                                  original, current))
+                    print >>sys.stderr, (
+                          "  Before: {}\n  After:  {} ".format(
+                                              original, current))
             # XXX (ncoghlan): for most resources (e.g. sys.path) identity
             # matters at least as much as value. For others (e.g. cwd),
             # identity is irrelevant. Should we add a mechanism to check