From 9d9a4a36614e31b3520e6310177b9a831c940631 Mon Sep 17 00:00:00 2001 From: Victor Chang Date: Tue, 3 Dec 2024 18:00:51 +0800 Subject: [PATCH] Configure pytest coverage Signed-off-by: Victor Chang --- .gitignore | 1 + pyproject.toml | 13 +++++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 82f9275..9986fbb 100644 --- a/.gitignore +++ b/.gitignore @@ -45,6 +45,7 @@ htmlcov/ .cache nosetests.xml coverage.xml +coverage.json *.cover *.py,cover .hypothesis/ diff --git a/pyproject.toml b/pyproject.toml index 3d988fe..29696c0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -83,8 +83,17 @@ max-line-length = 160 [tool.pytest.ini_options] pythonpath = "src" -addopts = [ - "--import-mode=importlib", +addopts = """ +--import-mode=importlib \ +--doctest-modules \ +--cov=./ \ +--cov-append \ +--cov-report json:tests/reports/coverage.json \ +--ignore=docs/ +""" + +testpaths = [ + "tests/unit", ] [build-system]