From fd955ba05497c8add703fdb9d0e9788fc1aa90bf Mon Sep 17 00:00:00 2001 From: Justin Mayer Date: Sun, 16 Jun 2024 19:16:58 +0200 Subject: [PATCH] Show missing line numbers via `invoke coverage` Also includes a change that causes this command to return a failing status when coverage drops below its current value of 74.8%. --- tasks.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tasks.py b/tasks.py index 64409e20..9a7564b2 100644 --- a/tasks.py +++ b/tasks.py @@ -47,7 +47,11 @@ def tests(c): @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}/pytest --cov=pelican --cov-report term-missing " + "--cov-fail-under 74.8", + pty=PTY, + ) c.run(f"{VENV_BIN}/coverage html", pty=PTY)