Improving coverage
I believe Rust 1.60 (due in six weeks' time) will contain a stabilised -C instrument-coverage flag to support the coverage for which we currently use nightly.
It might be interesting when that lands to rewrite our CI a bit so that coverage is done as part of all jobs, and we can then remove the separate coverage jobs. That should hopefully help give a truer picture of sections which really are covered however not reflected by the current setup.
Once that change is done, this issue (or another one) can become a general call to action for interested volunteers who'd like to help us bring that coverage number up towards 100% (the ideal, not sure if realistic).
The general steps I'd recommend for anyone who'd be interested in helping achieve that would be to look at the table of files at the bottom of https://app.codecov.io/gh/PyO3/pyo3, identify uncovered sections, and then write PRs adding tests to cover them.
Some issues with coverage that I'm aware of:
- Possible weirdness with codecov and PRs using
mainon the fork: https://github.com/PyO3/pyo3/pull/2175#issuecomment-1051104614 and - Probably impossible to cover some
assert!messages: https://github.com/PyO3/pyo3/pull/2175#issuecomment-1051111519 - Doctests don't contribute to coverage https://github.com/taiki-e/cargo-llvm-cov/issues/2