Skip to content

Commit

Permalink
Install and configure pytest-cov to measure/report coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
eecavanna committed Jul 15, 2024
1 parent e897827 commit 95e9705
Show file tree
Hide file tree
Showing 3 changed files with 96 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ __pycache__
# Performance profiling files.
/*.prof

# File generated by `coverage` package.
/.coverage

# Schema files.
/*.yaml

Expand Down
87 changes: 86 additions & 1 deletion poetry.lock

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

7 changes: 7 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,18 @@ pyinstrument = "^4.6.2"
# Usage: $ poetry run pytest
# Docs: https://docs.pytest.org/en/stable/contents.html
pytest = "^8.2.2"
pytest-cov = "^5.0.0"

[tool.poetry.scripts]
# Reference: https://python-poetry.org/docs/pyproject#scripts
refscan = "refscan.refscan:app"

[tool.pytest.ini_options]
# Make it so that, when `$ poetry run pytest` runs, in addition to running the tests, it
# also (via the `pytest-cov` plugin) measures test coverage of the source code directory.
# Reference: https://pytest-cov.readthedocs.io/en/latest/config.html#configuration
addopts = "--cov=refscan"

[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"

0 comments on commit 95e9705

Please sign in to comment.