Skip to content

Commit

Permalink
Run pytest under coverage.py
Browse files Browse the repository at this point in the history
This should still run the same pytest tests as usual, but will now
measure code coverage for anything under `tests/` and will fail if not
all code paths are exercised.

Would have prevented #122

Consider expanding coverage to the actual fauxmo code (`src/`)
eventually, but this should at least help ensure that the tests I
*think* are running are actually running.
  • Loading branch information
n8henrie committed Feb 19, 2024
1 parent 51c1a35 commit 8cb1c55
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ fauxmo = "fauxmo.cli:cli"
[project.optional-dependencies]
test = [
"black==23.1.0",
"coverage==7.4.1",
"flake8-docstrings==1.7.0",
"flake8-import-order==0.18.2",
"flake8==6.0.0",
Expand Down
3 changes: 2 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ isolated_build = True
[testenv]
extras = test
commands =
python -m pytest {posargs:--verbose --showlocals} tests/
python -m coverage run --source=tests -m pytest {posargs:--verbose --showlocals} tests/
python -m coverage report --fail-under=100

[testenv:lint]
extras = test
Expand Down

0 comments on commit 8cb1c55

Please sign in to comment.