Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a task test-coverage to generate a coverage report #3225

Merged
merged 1 commit into from
Oct 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
https://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 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