Sad to see an AI suggest these entries for a [tool.coverage.run] section: omit = tests/*, */__init__.py, */__main__.py, */cli.py, */setup.py, */__pycache__/*, */test_*.py nedbatchelder.com/blog/202008/...
Post
nedbatchelder.comYou should include your tests in coverageThis seems to be a recurring debate: should you measure the coverage of your tests? In my opinion, definitely yes.
I usually exclude them and then add an extra step in CI to ensure 100% test coverage on tests. I learnt this trick from youtu.be/70T6OxKwxm0
youtu.beyour tests should have 100% coverageYouTube video by anthonywritescode
That's good to ensure the tests are 100% even if the product is not. It might be easier to run everything just once and then assess the results: nedbatchelder.com/blog/202111/...
nedbatchelder.comCoverage goalsThere’s a feature request to add a <a href="https://github.com/nedbat/coveragepy/issues/691" rel="external noopener">per-file threshold</a> to coverage.py. I didn’t add the feature, I wrote a proof-of...
0 reposts1 like