]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
regrtest computes statistics (#108793)
authorVictor Stinner <vstinner@python.org>
Sat, 2 Sep 2023 16:09:36 +0000 (18:09 +0200)
committerGitHub <noreply@github.com>
Sat, 2 Sep 2023 16:09:36 +0000 (18:09 +0200)
commitd4e534cbb35678c82b3a1276826af55d7bfc23b6
tree6d161a616e91406d600e9e8ef1120705f47e7da4
parente7de0c5901b85a5241386a33f98c27a4e08d5384
regrtest computes statistics (#108793)

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.

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Lib/test/libregrtest/main.py
Lib/test/libregrtest/refleak.py
Lib/test/libregrtest/runtest.py
Lib/test/libregrtest/runtest_mp.py
Lib/test/libregrtest/save_env.py
Lib/test/support/__init__.py
Lib/test/test_netrc.py
Lib/test/test_pep646_syntax.py
Lib/test/test_regrtest.py
Lib/test/test_xml_etree.py