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

Not enough test coverage #23

Open
peturorri opened this issue Mar 9, 2021 · 0 comments
Open

Not enough test coverage #23

peturorri opened this issue Mar 9, 2021 · 0 comments

Comments

@peturorri
Copy link
Member

We could use having better code coverage of tests.

There is an easy way to get the coverage: There is a pytest plugin called pytest-cov that generates coverage reports.

pip install pytest pytest-cov
pytest --cov=src/tokenizer --cov-report=html

The current results look like this:

----------- coverage: platform linux, python 3.8.6-final-0 -----------
Name                           Stmts   Miss  Cover
--------------------------------------------------
src/tokenizer/__init__.py          7      0   100%
src/tokenizer/abbrev.py          157     12    92%
src/tokenizer/definitions.py     121      9    93%
src/tokenizer/main.py            103    103     0%
src/tokenizer/tokenizer.py      1168    200    83%
--------------------------------------------------
TOTAL                           1556    324    79%

and a html-report that highlights uncovered lines is generated in the folder htmlcov

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

1 participant