Skip to content

Commit

Permalink
tests: add --branch to coverage run (#2825)
Browse files Browse the repository at this point in the history
  • Loading branch information
Kludex authored Dec 28, 2024
1 parent 0dcbe6a commit 2c98fe3
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion scripts/test
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@ if [ -z $GITHUB_ACTIONS ]; then
scripts/check
fi

${PREFIX}coverage run -m pytest $@
# TODO: Remove this custom logic, and add `branch = true` to the `[coverage.run]` when we drop support for Python 3.9.
# See https://github.com/encode/starlette/issues/2452.
branch_option=$(python -c 'import sys; print("--branch" if sys.version_info >= (3, 10) else "")')
${PREFIX}coverage run $branch_option -m pytest $@

if [ -z $GITHUB_ACTIONS ]; then
scripts/coverage
Expand Down

0 comments on commit 2c98fe3

Please sign in to comment.