From 202e07d5fe47e703767cb9a600323e1490a6babd Mon Sep 17 00:00:00 2001 From: DavHau Date: Tue, 25 Jul 2023 00:59:51 +0200 Subject: [PATCH] clan-cli: hint on how to get coverage html --- .gitignore | 1 + pkgs/clan-cli/default.nix | 3 ++- pkgs/clan-cli/pyproject.toml | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 8893b551..d9994623 100644 --- a/.gitignore +++ b/.gitignore @@ -7,5 +7,6 @@ __pycache__ .mypy_cache .pytest_cache .pythonenv +.reports .ruff_cache htmlcov diff --git a/pkgs/clan-cli/default.nix b/pkgs/clan-cli/default.nix index 0fcc0c26..3b939a63 100644 --- a/pkgs/clan-cli/default.nix +++ b/pkgs/clan-cli/default.nix @@ -66,7 +66,8 @@ let cp -r ${src} ./src chmod +w -R ./src cd src - ${checkPython}/bin/python -m pytest ./tests + ${checkPython}/bin/python -m pytest ./tests \ + || echo -e "generate coverage report py running:\n pytest; firefox .reports/html/index.html" touch $out ''; diff --git a/pkgs/clan-cli/pyproject.toml b/pkgs/clan-cli/pyproject.toml index fa2a2939..eff85f56 100644 --- a/pkgs/clan-cli/pyproject.toml +++ b/pkgs/clan-cli/pyproject.toml @@ -9,7 +9,7 @@ dynamic = ["version"] scripts = {clan = "clan_cli:main"} [tool.pytest.ini_options] -addopts = "--cov . --cov-report term --cov-fail-under=100 --no-cov-on-fail" +addopts = "--cov . --cov-report term --cov-report html:.reports/html --cov-fail-under=100 --no-cov-on-fail" [tool.mypy] python_version = "3.10"