indrajithi / tiny-web-crawler

A simple and easy to use web crawler for Python
MIT License
55 stars 11 forks source link

Increased test coverage #29

Closed Mews closed 1 week ago

Mews commented 1 week ago

Related to #28 and #24

Changes Before, the test coverage was at around 79% (this is including the soon to be removed main function in crawler.py) I've added new test cases to test_crawler.py, so that now the test coverage is at 100% (excluding the main function)

I've also changed the ci workflow so that a coverage report is shown when running the tests, using the already installed pytest-cov extension

And I've also fixed some formatting issues present before my changes (not sure how they were passing the ci but they were getting found on my machine on the commit hook so I fixed them)

indrajithi commented 1 week ago

I've also changed the ci workflow so that a coverage report is shown when running the tests, using the already installed pytest-cov extension

Awesome!

Can we display it in Readme? Ideally we can make it like: If it falls below a threshold coverage (80%) the CI should fail. We can spec out that in a different issue.

Mews commented 1 week ago

I don't know about making the ci fail when its bellow a certain coverage percentage, but I can add a badge to the readme with the coverage percent, which then links to the full report. You can see how it'd look here for example :) It would use this action for it