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

Set COVERAGE_CORE=sysmon for faster test coverage on 3.12+ #172

Merged
merged 2 commits into from Feb 24, 2024

Conversation

hugovk
Copy link
Member

@hugovk hugovk commented Feb 24, 2024

Python 3.12 introduced sys.monitoring, that tools like coverage.py can use to improve performance.

It's not yet the default in coverage.py. To enable, we can set a COVERAGE_CORE=sysmon environment variable, that will switch to the faster mode when available, that is, in Python 3.12 and newer. Older versions will stick to the older method.

Not a huge difference with these fast tests, but reduces from ~2.93s seconds to 1.86s, about a third.

@hugovk hugovk added changelog: skip Exclude PR from release draft testing Unit tests, linting, CI, etc. labels Feb 24, 2024
Copy link

codecov bot commented Feb 24, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.19%. Comparing base (7cfa397) to head (2918ca3).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #172   +/-   ##
=======================================
  Coverage   99.19%   99.19%           
=======================================
  Files           9        9           
  Lines         746      746           
=======================================
  Hits          740      740           
  Misses          6        6           
Flag Coverage Δ
macos-latest 97.58% <ø> (ø)
ubuntu-latest 97.58% <ø> (ø)
windows-latest 96.11% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

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

@hugovk hugovk merged commit 584d470 into python-humanize:main Feb 24, 2024
32 checks passed
@hugovk hugovk deleted the coverage-sysmon branch February 24, 2024 10:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog: skip Exclude PR from release draft testing Unit tests, linting, CI, etc.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant