Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Adjust Python coverage test flags inpyprompt.toml for slight speedup#7777

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Draft
mhucka wants to merge2 commits intoquantumlib:main
base:main
Choose a base branch
Loading
frommhucka:mh-add-sysmon-flag

Conversation

@mhucka
Copy link
Contributor

@mhuckamhucka commentedNov 29, 2025
edited
Loading

This provides some slight speedups to Pytest coverage testing by making 2 changes:

  • Add a pytest flag topyproject.toml to use sys.monitoring if it is available. This can speed upcoverage.py. The reason is thatsys.monitoring (introduced in Python 3.12 via PEP 669) offers a more efficient way to monitor program execution, potentially leading to faster coverage measurement, especially for line coverage. This feature is only available for Python 3.12+, but it can be turned on always and warnings aboutnot having the sysmon feature can be ignored. Example of a project that found it useful:https://blog.trailofbits.com/2025/05/01/making-pypis-test-suite-81-faster/

  • Change the directories included and excluded to be more selective and get only the directories that have Python test files consumed by Pytest. By changinginclude andomit values fortool.coverage.run, I get a small but consistent ~5% speedup (on a Linux system when running with-n 32).

As of mid-2025, this feature is available in Python 3.12 and higher, andis reported to help speed up coverage tests.
@github-actionsgithub-actionsbot added the Size: XS<10 lines changed labelNov 29, 2025
@codecov
Copy link

codecovbot commentedNov 29, 2025
edited
Loading

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.94%. Comparing base (c6c0eff) to head (03d147e).

❗ There is a different number of reports uploaded between BASE (c6c0eff) and HEAD (03d147e). Click for more details.

HEAD has 2 uploads less than BASE
FlagBASE (c6c0eff)HEAD (03d147e)
42
Additional details and impacted files
@@            Coverage Diff             @@##             main    #7777      +/-   ##==========================================- Coverage   99.57%   90.94%   -8.63%==========================================  Files        1102       70    -1032       Lines       98425     3590   -94835     ==========================================- Hits        98006     3265   -94741+ Misses        419      325      -94

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report?Share it here.

🚀 New features to boost your workflow:
  • ❄️Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

By changing `include` and `omit` values for `tool.coverage.run`, we canlimit the files that pytest-cov scans to look foir tests and therebygain a slight speedup. (I'm seeing 5% faster times on a Linux systemwhen running with `-n 32`.)
@github-actionsgithub-actionsbot added size: S10< lines changed <50 and removed Size: XS<10 lines changed labelsNov 29, 2025
@mhuckamhucka changed the titleAddsysmon flag for coverage tests to pyprompt.tomlAdjust Python coverage test flags inpyprompt.toml for slight speedupNov 29, 2025
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@vtomolevtomoleAwaiting requested review from vtomolevtomole will be requested when the pull request is marked ready for reviewvtomole is a code owner

At least 1 approving review is required to merge this pull request.

Assignees

No one assigned

Labels

size: S10< lines changed <50

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

1 participant

@mhucka

[8]ページ先頭

©2009-2025 Movatter.jp