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

Consider integrating the covdefaults plugin #3163

Open
graingert opened this issue Dec 22, 2024 · 5 comments
Open

Consider integrating the covdefaults plugin #3163

graingert opened this issue Dec 22, 2024 · 5 comments

Comments

@graingert
Copy link
Member

          Consider integrating the `covdefaults` plugin, as it injects most of these automatically. The only thing you'd need to override additionally is the `fail_under` setting, which it sets to 100%, but it's not compatible with runtime-dependent tests that cannot reach 100% under one specific runtime. So it's good to set it to something sufficiently low while requiring 100% in Codecov.

Originally posted by @webknjaz in #3159 (comment)

@graingert graingert changed the title Consider integrating the covdefaults plugin, as it injects most of these automatically. The only thing you'd need to override additionally is the fail_under setting, which it sets to 100%, but it's not compatible with runtime-dependent tests that cannot reach 100% under one specific runtime. So it's good to set it to something sufficiently low while requiring 100% in Codecov. Consider integrating the covdefaults plugin, as it injects most of these automatically Dec 22, 2024
@graingert graingert changed the title Consider integrating the covdefaults plugin, as it injects most of these automatically Consider integrating the covdefaults plugin Dec 22, 2024
@graingert
Copy link
Member Author

https://github.com/asottile/covdefaults looks handy as it configures a bunch of nice settings

I'm not sure I agree with all the no-cov pragmas, however.

@jakkdl
Copy link
Member

jakkdl commented Dec 22, 2024

Ooh, the platform/version pragmas are a really interesting way of enforcing 100% coverage for each individual run. Maybe not for trio, but will consider it for projects which have a very small amount of platform/version-dependent code. This should be added to upstream coverage tbh

But yeah I'm not finding a way of removing some of the exclude_lines... looks like @webknjaz already opened an issue about that: asottile/covdefaults#152

@graingert
Copy link
Member Author

uvicorn uses an interesting approach: https://github.com/encode/uvicorn/blob/master/pyproject.toml#L124

@webknjaz
Copy link
Member

Oh, nice! More projects to try out for me :)

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

No branches or pull requests

3 participants