4 ms·
> pytest - Comprehensive test suite (80% coverage minimum) Why would this ever be less than 100%?
by adastra22 1y ago
> pytest - Comprehensive test suite (80% coverage minimum)
Why would this ever be less than 100%?
- sanyam-khurana 1y agoIt's configurable. The minimum quality gate check is set at 80% here: https://github.com/CuriousLearner/django-keel/blob/main/template/%7B%25%20if%20dependency_manager%20%3D%3D%20'uv'%20%25%7Dpyproject.toml%7B%25%20endif%20%25%7D.jinja https://github.com/CuriousLearner/django-keel/blob/main/temp... Also, to answer why ever be less than 100% is that it depends. Usually, I prefer writing behavioural & integration tests, over chasing per-line coverage which might give a false confidence. I'm not saying getting 100% coverage is bad, but with my experience working on several different projects, I've seen that the last 10-20% is usually low-value surface. For critical modules like auth, money, policies (business-logic), should aim at close to > 95%. When you reach that 100% mark, in my opinion, you might have to write brittle tests which slows down your refactoring with little risk reduction. Again, to summarize, it's not a black/white answer on having 100% or no coverage, but this differs from project to project, and generally having anything above 80% that covers the core-business logic of projects tends to work in my opinion.
- adastra22 1y agoIt was not at all clear to me that number was for code coverage. It sounded like it was permitting up to 20% of tests to be failing.
- sanyam-khurana 1y agoInteresting. Do you have any opinion on what this should be rephrased to, so that it's clearer?
- adastra22 1y agoExplicitly say code coverage or lines of code?
- momdad420 1y ago[dead]