Commit graph

3 commits

Author SHA1 Message Date
Serhiy Storchaka
d5c2d453fd
[3.12] gh-89392: Make test_pep646_syntax discoverable (GH-108861) (#108871)
* [3.12] gh-89392: Make test_pep646_syntax discoverable (GH-108861).
(cherry picked from commit d0b22f6bd8)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>

* Add "import unittest".
2023-09-04 18:41:42 +02:00
Victor Stinner
c8cf6be213
[3.12] gh-108822: regrtest computes statistics (#108793) (#108833)
gh-108822: 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.

Notes on the backport: doctest.TestResults.skipped is a new feature
in Python 3.13, so don't use it in the backport.

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
(cherry picked from commit d4e534cbb3)
2023-09-04 13:45:50 +02:00
Matthew Rahtz
e8e737bcf6
bpo-43224: Implement PEP 646 grammar changes (GH-31018)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2022-03-26 09:55:35 -07:00