[3.13] gh-119050: Add XML support to libregrtest refleak checker (GH-119148) (#119270)

gh-119050: Add XML support to libregrtest refleak checker (GH-119148)

regrtest test runner: Add XML support to the refleak checker
(-R option).

* run_unittest() now stores XML elements as string, rather than
  objects, in support.junit_xml_list.
* runtest_refleak() now saves/restores XML strings before/after
  checking for reference leaks. Save XML into a temporary file.
(cherry picked from commit 9257731f5d)

Co-authored-by: Victor Stinner <vstinner@python.org>
This commit is contained in:
Miss Islington (bot) 2024-05-21 00:50:20 +02:00 committed by GitHub
parent 071d996e13
commit 42a8d11752
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 39 additions and 25 deletions

View file

@ -520,15 +520,6 @@ def _parse_args(args, **kwargs):
"--huntrleaks without -jN option",
file=sys.stderr)
if ns.huntrleaks and ns.xmlpath:
# The XML data is written into a file outside runtest_refleak(), so
# it looks like a leak but it's not. Simply disable XML output when
# hunting for reference leaks (gh-83434).
ns.xmlpath = None
print("WARNING: Disable --junit-xml because it's incompatible "
"with --huntrleaks",
file=sys.stderr)
if ns.forever:
# --forever implies --failfast
ns.failfast = True