Skip to content

Commit

Permalink
Add Test Coverage reporting.
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathanza committed Jan 28, 2023
1 parent d78644d commit 2ebb1d9
Show file tree
Hide file tree
Showing 4 changed files with 107 additions and 24 deletions.
16 changes: 16 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[run]

include =
poker_*.py

omit =
*/__init__.py
*/tests/*
*/venv/*

[report]
exclude_lines =
raise NotImplementedError
return NotImplemented
return None
pass
1 change: 1 addition & 0 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ rich = "*"
black = "*"
pylint = "*"
isort = "*"
coverage = "*"

[requires]
python_version = "3.10"
Expand Down
104 changes: 81 additions & 23 deletions Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# PokerHand Class

[![Codacy Badge](https://api.codacy.com/project/badge/Grade/53ae48d1931949baa8e1dd1855ea364e)](https://app.codacy.com/gh/jonathanza/poker_hands?utm_source=github.com&utm_medium=referral&utm_content=jonathanza/poker_hands&utm_campaign=Badge_Grade_Settings)
[![Codacy Badge](https://app.codacy.com/project/badge/Grade/ec8a9ce37ca748f9b4226da7dd5efff9)](https://www.codacy.com/gh/jonathanza/poker_hands/dashboard?utm_source=github.com&utm_medium=referral&utm_content=jonathanza/poker_hands&utm_campaign=Badge_Grade) [![Codacy Badge](https://app.codacy.com/project/badge/Coverage/ec8a9ce37ca748f9b4226da7dd5efff9)](https://www.codacy.com/gh/jonathanza/poker_hands/dashboard?utm_source=github.com&utm_medium=referral&utm_content=jonathanza/poker_hands&utm_campaign=Badge_Coverage)

The `PokerHand` class is a Python class that can be used to classify a poker hand into one of the following categories:

Expand Down Expand Up @@ -156,6 +156,14 @@ pipenv install --skip-lock --dev --pre
pipenv shell
```

### Test Coverage

```bash
coverage run -m unittest unit_tests.py
coverage xml -o coverage.xml
bash <(curl -Ls https://coverage.codacy.com/get.sh) report -r coverage.xml
```

### Lint Code

#### [Black](https://pypi.org/project/black/)
Expand Down

0 comments on commit 2ebb1d9

Please sign in to comment.