From 3795f51161dd03b0933a323dc040e710a0bc3860 Mon Sep 17 00:00:00 2001 From: Daniel Tomlinson Date: Fri, 29 Oct 2021 17:45:40 +0100 Subject: [PATCH] adding coverage duty --- duties.py | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/duties.py b/duties.py index 62525c7..a813bbd 100644 --- a/duties.py +++ b/duties.py @@ -8,9 +8,24 @@ def test(ctx): @duty def update_deps(ctx, dry: bool = True): - # duty update_deps dry=False + """Update the dependencies using Poetry. + + Example: + `duty update_deps dry=False` + """ dry_run = "--dry-run" if dry else "" ctx.run( ["poetry", "update", dry_run], title=f"Updating poetry deps {dry_run}", ) + + +@duty +def coverage(ctx): + """Generate a coverage HTML report. + + Example: + `duty coverage` + """ + ctx.run(["coverage", "run", "--source", "tembo", "-m", "pytest"]) + ctx.run(["coverage", "html"])