From: Marcelo Trylesinski Date: Sat, 28 Dec 2024 20:29:57 +0000 (+0100) Subject: tests: add `--branch` to coverage run (#2825) X-Git-Tag: 0.45.0~3 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2c98fe335888beda9a67235c79c41d754df3c99c;p=thirdparty%2Fstarlette.git tests: add `--branch` to coverage run (#2825) --- diff --git a/scripts/test b/scripts/test index 720a6639..17dd9fb6 100755 --- a/scripts/test +++ b/scripts/test @@ -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