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

Get 100% test coverage #13

Closed
simonw opened this issue Aug 15, 2020 · 4 comments
Closed

Get 100% test coverage #13

simonw opened this issue Aug 15, 2020 · 4 comments
Labels
enhancement New feature or request

Comments

@simonw
Copy link
Owner

simonw commented Aug 15, 2020

Since this code is security related (and quite complicated) I'm going to shoot for 100% coverage.

pip install pytest-cov
pytest --cov=asgi_csrf --cov-report=html
open htmlcov/index.html

https://asgi-csrf-htmlcov.simonw.vercel.app/asgi_csrf_py.html 92% covered.

@simonw simonw added the enhancement New feature or request label Aug 15, 2020
@simonw
Copy link
Owner Author

simonw commented Aug 15, 2020

$ pytest --cov-fail-under=100 --cov asgi_csrf 
======= test session starts =======
platform darwin -- Python 3.7.3, pytest-6.0.1, py-1.9.0, pluggy-0.13.1
rootdir: /Users/simon/Dropbox/Development/asgi-csrf
plugins: cov-2.10.1, asyncio-0.14.0
collected 18 items                                                                                                                                                   

test_asgi_csrf.py ..................                                                                                                                           [100%]

---------- coverage: platform darwin, python 3.7.3-final-0 -----------
Name           Stmts   Miss  Cover
----------------------------------
asgi_csrf.py     169     13    92%

FAIL Required test coverage of 100% not reached. Total coverage: 92.31%

@simonw
Copy link
Owner Author

simonw commented Aug 15, 2020

The rest of this work will take place in PR #14

@simonw
Copy link
Owner Author

simonw commented Aug 15, 2020

I'm going to set up https://codecov.io/ for this repo.

https://codecov.io/gh/simonw/asgi-csrf

@simonw
Copy link
Owner Author

simonw commented Aug 15, 2020

I added a CODECOV_TOKEN secret to this repo.

simonw added a commit that referenced this issue Aug 15, 2020
simonw added a commit that referenced this issue Aug 15, 2020
simonw added a commit that referenced this issue Aug 15, 2020
simonw added a commit that referenced this issue Aug 15, 2020
@simonw simonw closed this as completed in 57c215e Aug 15, 2020
simonw added a commit that referenced this issue Aug 15, 2020
simonw added a commit that referenced this issue Aug 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant