Skip to content

tox nocov: fix by overriding pytest.ini addopts#570

Merged
webknjaz merged 1 commit intoaio-libs:masterfrom
loqs:tox-nocover
Apr 25, 2026
Merged

tox nocov: fix by overriding pytest.ini addopts#570
webknjaz merged 1 commit intoaio-libs:masterfrom
loqs:tox-nocover

Conversation

@loqs
Copy link
Copy Markdown
Contributor

@loqs loqs commented Apr 10, 2026

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

  • I think the code is well written
  • Unit tests for the changes exist
  • tox testenvs have been executed in the following environments:
    • Linux (Ubuntu 18.04, Ubuntu 20.04, Arch): {py36,py37,py38,py39}-nocov
    • Windows (7, 10): {py36,py37,py38,py39}-{nocov,cov,diffcov}
    • WSL 1.0 (Ubuntu 18.04): {py36,py37,py38,py39}-{nocov,cov,diffcov}, pypy3-{nocov,cov}, qa, docs
    • FreeBSD (12.2, 12.1, 11.4): {py36,pypy3}-{nocov,cov,diffcov}, qa
    • Cygwin: py36-{nocov,cov,diffcov}, qa, docs
  • Documentation reflects the changes
  • Add a news fragment into the NEWS.rst file
    • Add under the "aiosmtpd-next" section, creating one if necessary
      • You may create subsections to group the changes, if you like
    • Use full sentences with correct case and punctuation
    • Refer to relevant Issue if applicable

Comment thread tox.ini Outdated
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 webknjaz enabled auto-merge (squash) April 25, 2026 21:14
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 25, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.84%. Comparing base (98f5783) to head (c0ca25b).
⚠️ Report is 1 commits behind head on master.

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.
📢 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.

@webknjaz webknjaz disabled auto-merge April 25, 2026 21:40
@webknjaz webknjaz merged commit a55d3de into aio-libs:master Apr 25, 2026
19 of 22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants