tox nocov: fix by overriding pytest.ini addopts#570
Merged
webknjaz merged 1 commit intoaio-libs:masterfrom Apr 25, 2026
Merged
Conversation
webknjaz
reviewed
Apr 24, 2026
The nocov environments were failing because pytest.ini includes --cov options in addopts, which pytest treats as unrecognized arguments when the cov plugin is disabled with -p no:cov. This change uses the --no-cov flag provided by pytest-cov. This requires making pytest-cov unconditional (removing !nocov: prefix) so the plugin is available to handle the --no-cov flag.
webknjaz
approved these changes
Apr 25, 2026
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #570 +/- ##
==========================================
+ Coverage 97.82% 97.84% +0.01%
==========================================
Files 23 23
Lines 5701 5701
Branches 766 766
==========================================
+ Hits 5577 5578 +1
- Misses 78 79 +1
+ Partials 46 44 -2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What do these changes do?
The nocov environments were failing because pytest.ini added in 8d81f96 includes --cov options in addopts, which pytest treats as unrecognized arguments when the cov plugin is disabled with -p no:cov.
Adding --override-ini='addopts=' to the nocov command in tox.ini, clears the conflicting pytest.ini settings while keeping the GitHub CI workflow intact (which runs pytest directly without tox).
Are there changes in behavior for the user?
No.
Related issue number
Related #544.
Checklist
{py36,py37,py38,py39}-nocov{py36,py37,py38,py39}-{nocov,cov,diffcov}{py36,py37,py38,py39}-{nocov,cov,diffcov}, pypy3-{nocov,cov}, qa, docs{py36,pypy3}-{nocov,cov,diffcov}, qapy36-{nocov,cov,diffcov}, qa, docsNEWS.rstfile