httpx/scripts/test
Tom Christie 0a8b0c65bd
Enforce coverage (#955)
* Enforce coverage when running tests

* Enforce test coverage
2020-05-15 16:17:33 +01:00

29 lines
493 B
Bash
Executable File

#!/bin/sh
export PREFIX=""
if [ -d 'venv' ] ; then
export PREFIX="venv/bin/"
fi
if [ -z $GITHUB_ACTIONS ]; then
set +e
scripts/check
while [ $? -ne 0 ]; do
read -p "Running 'scripts/check' failed. Do you want to run 'scripts/lint' now? [y/N] " yn
case $yn in
[Yy]* ) :;;
* ) exit;;
esac
scripts/lint
scripts/check
done
fi
set -ex
${PREFIX}pytest $@
if [ -z $GITHUB_ACTIONS ]; then
scripts/coverage
fi