Skip to content

Commit

Permalink
Add a task test-coverage to generate a coverage report
Browse files Browse the repository at this point in the history
Add a one-liner about "invoke".
  • Loading branch information
boxydog committed Oct 28, 2023
1 parent 269751b commit 35bc51a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
3 changes: 3 additions & 0 deletions docs/contribute.rst
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@ via::

invoke tests

(For more on invoke, see `invoke -l` to list tasks, or
[pinvoke.org](pyinvoke.org) for documentation.)

In addition to running the test suite, it is important to also ensure that any
lines you changed conform to code style guidelines. You can check that via::

Expand Down
7 changes: 7 additions & 0 deletions tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,13 @@ def tests(c):
c.run(f"{VENV_BIN}/pytest", pty=PTY)


@task
def test_coverage(c):
"""Generate code coverage of running the test suite"""
c.run(f"{VENV_BIN}/pytest --cov=pelican", pty=PTY)
c.run(f"{VENV_BIN}/coverage html", pty=PTY)


@task
def black(c, check=False, diff=False):
"""Run Black auto-formatter, optionally with --check or --diff"""
Expand Down

0 comments on commit 35bc51a

Please sign in to comment.