summaryrefslogtreecommitdiff
path: root/Lib/test/libregrtest/utils.py
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@redhat.com>2019-04-26 04:08:53 +0200
committerGitHub <noreply@github.com>2019-04-26 04:08:53 +0200
commit4d29983185bc12ca685a1eb3873bacb8a7b67416 (patch)
tree26457c1f05ba31ed1cb1421b7ea50b8f98630a21 /Lib/test/libregrtest/utils.py
parent9db0324712f6982d89620b420f507a6aa5da152f (diff)
downloadcpython-git-4d29983185bc12ca685a1eb3873bacb8a7b67416.tar.gz
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/utils.py')
-rw-r--r--Lib/test/libregrtest/utils.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/Lib/test/libregrtest/utils.py b/Lib/test/libregrtest/utils.py
index d36bf91966..fb9971a64f 100644
--- a/Lib/test/libregrtest/utils.py
+++ b/Lib/test/libregrtest/utils.py
@@ -1,5 +1,6 @@
-import os.path
import math
+import os.path
+import sys
import textwrap
@@ -54,3 +55,7 @@ def printlist(x, width=70, indent=4, file=None):
print(textwrap.fill(' '.join(str(elt) for elt in sorted(x)), width,
initial_indent=blanks, subsequent_indent=blanks),
file=file)
+
+
+def print_warning(msg):
+ print(f"Warning -- {msg}", file=sys.stderr, flush=True)