Skip to content

Commit 2c98fe3

Browse files
authored
tests: add --branch to coverage run (#2825)
1 parent 0dcbe6a commit 2c98fe3

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

scripts/test

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,10 @@ if [ -z $GITHUB_ACTIONS ]; then
1111
scripts/check
1212
fi
1313

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

1619
if [ -z $GITHUB_ACTIONS ]; then
1720
scripts/coverage

0 commit comments

Comments
 (0)