Skip to content

Commit

Permalink
coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
adamstok committed Oct 6, 2020
1 parent c1fc9ab commit 988c259
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 2 deletions.
22 changes: 20 additions & 2 deletions tests/README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,27 @@
#### Testing with unittest
---
#### [Unittest](https://docs.python.org/3/library/unittest.html)
The tests.py is a simple example of using unittest.

Just have fun adding some new tests, modify them, etc :)

Usage:
`python -m unittest -v tests.Testing`


---

### [Coverage](https://coverage.readthedocs.io/en/coverage-5.3/)
Coverage.py is a tool for measuring code coverage of Python programs. It monitors your program, noting which parts of the code have been executed, then analyzes the source to identify code that could have been executed but was not.

Usage:

Run:
`coverage run ../community-version.py ../ztm-logo.png`

See the report:
`coverage report`

See the report in html with a view of what was tested:
```cov
coverage html
(this command will create a folder 'htmlcov' with the test report in html)
```
2 changes: 2 additions & 0 deletions tests/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
coverage==5.3
pytest==6.1.1

0 comments on commit 988c259

Please sign in to comment.