Skip to content

Commit 51fddc1

Browse files
committed
add optional --no-coverage flag
1 parent a7f4d7d commit 51fddc1

File tree

1 file changed

+18
-3
lines changed

1 file changed

+18
-3
lines changed

backend/scripts/test.sh

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,21 @@
33
set -e
44
set -x
55

6-
coverage run --source=app -m pytest
7-
coverage report --show-missing
8-
coverage html --title "${@-coverage}"
6+
NO_COVERAGE=0
7+
8+
# Check for the --no-coverage flag
9+
for arg in "$@"; do
10+
if [ "$arg" == "--no-coverage" ]; then
11+
NO_COVERAGE=1
12+
shift
13+
break
14+
fi
15+
done
16+
17+
if [ $NO_COVERAGE -eq 0 ]; then
18+
coverage run --source=app -m pytest "$@"
19+
coverage report --show-missing
20+
coverage html --title "Coverage Report"
21+
else
22+
pytest "$@"
23+
fi

0 commit comments

Comments
 (0)