[3.12] regrtest computes statistics (GH-108793)#108818
[3.12] regrtest computes statistics (GH-108793)#108818miss-islington wants to merge 2 commits intopython:3.12from
Conversation
test_netrc, test_pep646_syntax and test_xml_etree now return results in the test_main() function. Changes: * Rewrite TestResult as a dataclass with a new State class. * Add test.support.TestStats class and Regrtest.stats_dict attribute. * libregrtest.runtest functions now modify a TestResult instance in-place. * libregrtest summary lists the number of run tests and skipped tests, and denied resources. * Add TestResult.has_meaningful_duration() method. * Compute TestResult duration in the upper function. * Use time.perf_counter() instead of time.monotonic(). * Regrtest: rename 'resource_denieds' attribute to 'resource_denied'. * Rename CHILD_ERROR to MULTIPROCESSING_ERROR. * Use match/case syntadx to have different code depending on the test state. (cherry picked from commit d4e534c) Co-authored-by: Victor Stinner <vstinner@python.org> Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
vstinner
left a comment
There was a problem hiding this comment.
LGTM, good bot.
It can wait for Python 3.12.1.
|
In general, I'm trying to keep libregrtest the same in all stable branches. It seems like 3.11 has an outdated libregrtest :-( |
I backported the statistics change to Python 3.11: #108820 I would prefer to have the same code in 3.11, 3.12 and main branches to ease future backports. |
|
Can you take a look at the test failures? |
Oh. I missed the fact that the final changes uses the I close this broken backport PR and backported the change manually to Python 3.12 to adapt it to Python 3.12 API: PR #108833. |
test_netrc, test_pep646_syntax and test_xml_etree now return results
in the test_main() function.
Changes:
in-place.
tests, and denied resources.
test state.
(cherry picked from commit d4e534c)
Co-authored-by: Victor Stinner vstinner@python.org
Co-authored-by: Alex Waygood Alex.Waygood@Gmail.com