]> granicus.if.org Git - python/commitdiff
bpo-30764: Fix regrtest --fail-env-changed --forever (#2536)
authorVictor Stinner <victor.stinner@gmail.com>
Mon, 3 Jul 2017 09:15:58 +0000 (11:15 +0200)
committerGitHub <noreply@github.com>
Mon, 3 Jul 2017 09:15:58 +0000 (11:15 +0200)
--forever now stops if a fail changes the environment.

Lib/test/libregrtest/main.py

index 571eb6112520eb4442ce6d4de226fc3ba1512733..bc8155bbff2b478a5de50ef84ee55e9dc84753ee 100644 (file)
@@ -415,6 +415,8 @@ class Regrtest:
                 yield test
                 if self.bad:
                     return
+                if self.ns.fail_env_changed and self.environment_changed:
+                    return
 
     def display_header(self):
         # Print basic platform information
@@ -478,7 +480,7 @@ class Regrtest:
             result = "FAILURE"
         elif self.interrupted:
             result = "INTERRUPTED"
-        elif self.environment_changed and self.ns.fail_env_changed:
+        elif self.ns.fail_env_changed and self.environment_changed:
             result = "ENV CHANGED"
         else:
             result = "SUCCESS"