Skip to content

[3.12] regrtest computes statistics (GH-108793) - #108818

Closed
miss-islington wants to merge 2 commits into
python:3.12from
miss-islington:backport-d4e534c-3.12
Closed

[3.12] regrtest computes statistics (GH-108793)#108818
miss-islington wants to merge 2 commits into
python:3.12from
miss-islington:backport-d4e534c-3.12

Conversation

@miss-islington

Copy link
Copy Markdown
Contributor

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

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>

@vstinnervstinner left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, good bot.

It can wait for Python 3.12.1.

@vstinner

Copy link
Copy Markdown
Member

In general, I'm trying to keep libregrtest the same in all stable branches. It seems like 3.11 has an outdated libregrtest :-(

@vstinner

Copy link
Copy Markdown
Member

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.

@Yhg1s

Yhg1s commented Sep 2, 2023

Copy link
Copy Markdown
Member

Can you take a look at the test failures?

@vstinner

Copy link
Copy Markdown
Member

Can you take a look at the test failures?

Oh. I missed the fact that the final changes uses the doctest.TestResults.skipped attribute which I just added to Python 3.13.

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.

@vstinnervstinner closed this Sep 2, 2023
@miss-islington
miss-islington deleted the backport-d4e534c-3.12 branch September 2, 2023 23:41
Sign up for freeto 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.

4 participants

@miss-islington@vstinner@Yhg1s@bedevere-bot