Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Run tests using coverage run #239

Closed
flying-sheep opened this issue Nov 13, 2023 · 0 comments · Fixed by #244
Closed

Run tests using coverage run #239

flying-sheep opened this issue Nov 13, 2023 · 0 comments · Fixed by #244

Comments

@flying-sheep
Copy link
Member

flying-sheep commented Nov 13, 2023

Currently neither pytest --cov nor coverage run -m pytest come without drawbacks:

  • pytest --cov only starts collecting coverage after plugins have been loaded, so it doesn’t correctly collect coverage in some situations. coverage run is just more reliable.
  • But covtest run doesn’t have pytest’s behavior of not adding the working directory to sys.path and can’t be made to do that: coverage run breaks PYTHONSAFEPATH nedbat/coveragepy#1696

I think due to our use of the src layout, the latter is the better tradeoff

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant