From f62057fd259afa98d0785b4701db712e52a0faee Mon Sep 17 00:00:00 2001 From: Eric Riddoch Date: Mon, 20 May 2024 14:16:05 -0600 Subject: [PATCH] patch: fixed a bug in run.sh:run-tests with the test-reports dir --- {{cookiecutter.repo_name}}/run.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/{{cookiecutter.repo_name}}/run.sh b/{{cookiecutter.repo_name}}/run.sh index 362f01a..dd5887a 100755 --- a/{{cookiecutter.repo_name}}/run.sh +++ b/{{cookiecutter.repo_name}}/run.sh @@ -47,7 +47,11 @@ function test:ci { # (example) ./run.sh test tests/test_states_info.py::test__slow_add function run-tests { PYTEST_EXIT_STATUS=0 - rm -rf "$THIS_DIR/test-reports" || true + + # clean the test-reports dir + rm -rf "$THIS_DIR/test-reports" || mkdir "$THIS_DIR/test-reports" + + # execute the tests, calculate coverage, and generate coverage reports in the test-reports dir python -m pytest ${@:-"$THIS_DIR/tests/"} \ --cov "${COVERAGE_DIR:-$THIS_DIR/src}" \ --cov-report html \