From cfc2ccb89b316e1fe01d4dfdb4bfcece8694bb52 Mon Sep 17 00:00:00 2001 From: Tyrel Souza <923113+tyrelsouza@users.noreply.github.com> Date: Thu, 4 Nov 2021 23:03:52 -0400 Subject: [PATCH] coverage task --- .coveragerc | 2 ++ .gitignore | 1 + tasks.py | 5 +++++ 3 files changed, 8 insertions(+) create mode 100644 .coveragerc diff --git a/.coveragerc b/.coveragerc new file mode 100644 index 0000000..e79111d --- /dev/null +++ b/.coveragerc @@ -0,0 +1,2 @@ +[html] +directory = coverage_html_report diff --git a/.gitignore b/.gitignore index c101db7..978dfdb 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ env/ Session.vim Session.nvim __pycache__/ +.coverage diff --git a/tasks.py b/tasks.py index 2b1386d..de61457 100644 --- a/tasks.py +++ b/tasks.py @@ -11,6 +11,11 @@ def run(c): def test(c): c.run("pytest --cov=. *_tests.py") +@task(pre=[test]) +def coverage(c): + c.run("coverage html") + c.run("xdg-open coverage_html_report/index.html") + @task def black(c):