diff --git a/.vscode/settings.json b/.vscode/settings.json index b0d31c2e..8d7eb29a 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -71,7 +71,8 @@ "author_email", "repo_name", "package_name", - "module_name" + "module_name", + "test_coverage_threshold" ], "vscode-yaml-sort.noCompatMode": true, "vscode-yaml-sort.sortOnSave": 2, diff --git a/Makefile b/Makefile index 0e07f1c4..7095a97e 100644 --- a/Makefile +++ b/Makefile @@ -60,7 +60,7 @@ toml-sort: ${PIPRUN} toml-sort pyproject.toml tests: - ${PIPRUN} python -m pytest --cov-fail-under=$(or $(SS_TEST_COVERAGE_MIN),100) . + ${PIPRUN} python -m pytest . freeze: @${PIPRUN} pip freeze --exclude-editable diff --git a/Makefile.jinja b/Makefile.jinja index 9a9436e5..fb548267 100644 --- a/Makefile.jinja +++ b/Makefile.jinja @@ -62,7 +62,7 @@ toml-sort: ${PIPRUN} toml-sort pyproject.toml tests: - ${PIPRUN} python -m pytest --cov-fail-under=$(or $(SS_TEST_COVERAGE_MIN),100) . + ${PIPRUN} python -m pytest . freeze: @${PIPRUN} pip freeze --exclude-editable diff --git a/copier.yaml b/copier.yaml index 4e397b5e..10706a20 100644 --- a/copier.yaml +++ b/copier.yaml @@ -41,3 +41,7 @@ module_name: default: '{{ package_name|lower|replace("-", "_") }}' help: 'Module name:' type: str +test_coverage_threshold: + default: 100 + help: 'Threshold for test coverage:' + type: int diff --git a/pyproject.toml b/pyproject.toml index 62960a30..813473fd 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -69,7 +69,7 @@ warn_return_any = true warn_unused_ignores = true [tool.pytest.ini_options] -addopts = "-l -s --durations=0 --cov=src --cov-report term --cov-report xml" +addopts = "-l -s --durations=0 --cov=src --cov-report term --cov-report xml --cov-fail-under=100" log_cli = true log_cli_level = "info" log_date_format = "%Y-%m-%d %H:%M:%S" diff --git a/pyproject.toml.jinja b/pyproject.toml.jinja index 998561fc..2340d595 100644 --- a/pyproject.toml.jinja +++ b/pyproject.toml.jinja @@ -73,7 +73,7 @@ warn_return_any = true warn_unused_ignores = true [tool.pytest.ini_options] -addopts = "-l -s --durations=0 --cov=src --cov-report term --cov-report xml" +addopts = "-l -s --durations=0 --cov=src --cov-report term --cov-report xml --cov-fail-under={{ test_coverage_threshold }}" log_cli = true log_cli_level = "info" log_date_format = "%Y-%m-%d %H:%M:%S"