Skip to content

Commit

Permalink
add optional --no-coverage flag
Browse files Browse the repository at this point in the history
  • Loading branch information
JakNowy committed Jun 28, 2024
1 parent a7f4d7d commit 51fddc1
Showing 1 changed file with 18 additions and 3 deletions.
21 changes: 18 additions & 3 deletions backend/scripts/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,21 @@
set -e
set -x

coverage run --source=app -m pytest
coverage report --show-missing
coverage html --title "${@-coverage}"
NO_COVERAGE=0

# Check for the --no-coverage flag
for arg in "$@"; do
if [ "$arg" == "--no-coverage" ]; then
NO_COVERAGE=1
shift
break
fi
done

if [ $NO_COVERAGE -eq 0 ]; then
coverage run --source=app -m pytest "$@"
coverage report --show-missing
coverage html --title "Coverage Report"
else
pytest "$@"
fi

0 comments on commit 51fddc1

Please sign in to comment.