Skip to content

Commit

Permalink
Add coverage check to tests
Browse files Browse the repository at this point in the history
  • Loading branch information
readicculus committed May 3, 2024
1 parent 6dd4a91 commit 1bfdacc
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 6 deletions.
5 changes: 3 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,14 @@ test :

.PHONY : clean
clean :
rm -rf src/pysh/*.egg-info/
rm -rf src/*.egg-info
rm -rf build/
rm -rf dist/
rm -rf .coverage

.PHONY : build
build :
rm -rf src/pysh/*.egg-info/
rm -rf src/*.egg-info
python -m build

.PHONY : release
Expand Down
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@

# Pysh - a phish.net API client in Python
![](https://github.com/readicculus/pysh/actions/workflows/main.yml/badge.svg)
[![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)

Pysh is a Python wrapper for the [phish.net](phish.net) API that can be used to query for Phish songs,
setlists, shows, venues, and other phish related data. This project is not associated with phish.net and you must
follow their API's terms of service while using this project.
Expand Down
29 changes: 25 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -119,13 +119,34 @@ python_classes = [
"Test*",
"*Test"
]
addopts = "--cov=src/ --cov-report term-missing"

pythonpath = [
"src/"
]

[tool.coverage.run]
source = ["src"]

log_format = "%(asctime)s - %(levelname)s - %(name)s - %(message)s"
log_level = "DEBUG"
branch = true

[tool.coverage.report]
#fail_under = 80
# Regexes for lines to exclude from consideration
exclude_also = [
# Don't complain about missing debug-only code:
"def __repr__",
"if self\\.debug",

# Don't complain if tests don't hit defensive assertion code:
"raise AssertionError",
"raise NotImplementedError",

# Don't complain if non-runnable code isn't run:
"if 0:",
"if __name__ == .__main__.:",

# Don't complain about abstract methods, they aren't run:
"@(abc\\.)?abstractmethod",
]

[tool.coverage.html]
directory = "build/coverage_html_report"

0 comments on commit 1bfdacc

Please sign in to comment.