Skip to content

Commit

Permalink
Create coverage invoke
Browse files Browse the repository at this point in the history
  • Loading branch information
yalef committed Dec 4, 2023
1 parent e878b49 commit 2684534
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
3 changes: 1 addition & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,7 @@ repos:

- id: tests
name: run tests
entry:
inv python.run " -m coverage run -m pytest -v"
entry: inv ci.coverage
language: system
pass_filenames: false
types: [ python ]
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ test: ## run tests quickly with the default Python
pytest

coverage: ## check code coverage quickly with the default Python
coverage run --source import_export_extensions --omit import_export_extensions/migrations -m pytest
coverage run -m pytest
coverage report -m
coverage html
$(BROWSER) htmlcov/index.html
Expand Down
9 changes: 9 additions & 0 deletions provision/ci.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,12 @@ def prepare(context):
saritasa_invocations.docker.up(context)
saritasa_invocations.github_actions.set_up_hosts(context)
saritasa_invocations.poetry.install(context)


@task
def coverage(context):
"""Run tests through coverage to generate coverage report."""
saritasa_invocations.python.run(
context,
command="-m coverage run -m pytest -v",
)

0 comments on commit 2684534

Please sign in to comment.