bpo-41718: Disable support.testresult XML output by default (GH-24982)

RegressionTestResult.USE_XML must now be set to True to get the JUnit
XML output.

Reduce the number of imports when --junit-xml=FILE option is not
used: 153 => 144 (-9).
This commit is contained in:
Victor Stinner 2021-03-23 01:11:31 +01:00 committed by GitHub
parent 0473fb2229
commit 30793e81bd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 22 additions and 7 deletions

View file

@ -93,6 +93,10 @@ def setup_tests(ns):
support.SHORT_TIMEOUT = min(support.SHORT_TIMEOUT, ns.timeout)
support.LONG_TIMEOUT = min(support.LONG_TIMEOUT, ns.timeout)
if ns.xmlpath:
from test.support.testresult import RegressionTestResult
RegressionTestResult.USE_XML = True
def replace_stdout():
"""Set stdout encoder error handler to backslashreplace (as stderr error