Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[3.12] gh-108822: regrtest computes statistics (#108793) #108833

Merged
merged 1 commit into from
Sep 4, 2023

Conversation

vstinner
Copy link
Member

@vstinner vstinner commented Sep 2, 2023

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 d4e534c)

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 d4e534c)
@vstinner
Copy link
Member Author

vstinner commented Sep 3, 2023

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

@vstinner
Copy link
Member Author

vstinner commented Sep 3, 2023

In general, I'm trying to keep libregrtest the same in all stable branches.

Python 3.11 has an outdated libregrtest. I wrote to backport regrtest changes of last months to Python 3.11: #108820 I just merged my PR.

@Yhg1s Yhg1s merged commit c8cf6be into python:3.12 Sep 4, 2023
@vstinner vstinner deleted the regrtest312 branch September 4, 2023 19:42
@vstinner
Copy link
Member Author

vstinner commented Sep 4, 2023

@Yhg1s Yhg1s merged commit c8cf6be into python:3.12 Sep 4, 2023

Thanks. IMO it's good to have it! If there is any regression, well, it will be fixed as usual :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants