forked from zero-to-mastery/ascii-art
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
22 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
coverage==5.3 | ||
pytest==6.1.1 |