summaryrefslogtreecommitdiffstats
path: root/Lib/test/libregrtest/save_env.py
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@redhat.com>2019-04-26 02:08:53 (GMT)
committerGitHub <noreply@github.com>2019-04-26 02:08:53 (GMT)
commit4d29983185bc12ca685a1eb3873bacb8a7b67416 (patch)
tree26457c1f05ba31ed1cb1421b7ea50b8f98630a21 /Lib/test/libregrtest/save_env.py
parent9db0324712f6982d89620b420f507a6aa5da152f (diff)
downloadcpython-4d29983185bc12ca685a1eb3873bacb8a7b67416.zip
cpython-4d29983185bc12ca685a1eb3873bacb8a7b67416.tar.gz
cpython-4d29983185bc12ca685a1eb3873bacb8a7b67416.tar.bz2
bpo-36725: regrtest: add TestResult type (GH-12960)
* Add TestResult and MultiprocessResult types to ensure that results always have the same fields. * runtest() now handles KeyboardInterrupt * accumulate_result() and format_test_result() now takes a TestResult * cleanup_test_droppings() is now called by runtest() and mark the test as ENV_CHANGED if the test leaks support.TESTFN file. * runtest() now includes code "around" the test in the test timing * Add print_warning() in test.libregrtest.utils to standardize how libregrtest logs warnings to ease parsing the test output. * support.unload() is now called with abstest rather than test_name * Rename 'test' variable/parameter to 'test_name' * dash_R(): remove unused the_module parameter * Remove unused imports
Diffstat (limited to 'Lib/test/libregrtest/save_env.py')
-rw-r--r--Lib/test/libregrtest/save_env.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/test/libregrtest/save_env.py b/Lib/test/libregrtest/save_env.py
index 2313b71..31931f2 100644
--- a/Lib/test/libregrtest/save_env.py
+++ b/Lib/test/libregrtest/save_env.py
@@ -9,6 +9,7 @@ import sysconfig
import threading
import warnings
from test import support
+from test.libregrtest.utils import print_warning
try:
import _multiprocessing, multiprocessing.process
except ImportError:
@@ -283,8 +284,7 @@ class saved_test_environment:
self.changed = True
restore(original)
if not self.quiet and not self.pgo:
- print(f"Warning -- {name} was modified by {self.testname}",
- file=sys.stderr, flush=True)
+ print_warning(f"{name} was modified by {self.testname}")
print(f" Before: {original}\n After: {current} ",
file=sys.stderr, flush=True)
return False