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

Cookbook: Please consider adding a recipe for nox + pytest + coverage #898

Open
Ravencentric opened this issue Nov 26, 2024 · 0 comments
Open

Comments

@Ravencentric
Copy link

Ravencentric commented Nov 26, 2024

How would this feature be useful?

My use case:

  1. I use nox to run tests for python 3.9, 3.10, 3.11, 3.12, and 3.13
  2. I need to run coverage on every single python version to test code for paths that rely on python version. This should produce one coverage data file for each run.
  3. I need to then run coverage combine to get the full report across all versions.

Common pitfalls:

  1. Coverage has a default filename which will get overwritten every run unless configured otherwise.
  2. I have to make sure there's no existing coverage file before running the tests and generating new ones.
  3. Cleanup the multiple coverage files produced from each run and only keep the combined report

Describe the solution you'd like

A nox + pytest + coverage recipe on cookbook

Describe alternatives you've considered

Here's my current working recipe (I'm not sure if it's the best way, but it works):
noxfile.py
pyproject.toml

Anything else?

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

1 participant