diff --git a/scripts/coverage b/scripts/coverage new file mode 100755 index 00000000..0e9b71c3 --- /dev/null +++ b/scripts/coverage @@ -0,0 +1,11 @@ +#!/bin/sh -e + +export PREFIX="" +if [ -d 'venv' ] ; then + export PREFIX="venv/bin/" +fi +export SOURCE_FILES="httpx tests" + +set -x + +${PREFIX}coverage report --show-missing --skip-covered --fail-under=91 diff --git a/scripts/test b/scripts/test index 6a4a752f..7b35d2af 100755 --- a/scripts/test +++ b/scripts/test @@ -1,14 +1,28 @@ -#!/bin/sh -e +#!/bin/sh export PREFIX="" if [ -d 'venv' ] ; then export PREFIX="venv/bin/" fi -set -x - 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 diff --git a/setup.cfg b/setup.cfg index 5cff3486..f49112b6 100644 --- a/setup.cfg +++ b/setup.cfg @@ -17,6 +17,6 @@ line_length = 88 multi_line_output = 3 [tool:pytest] -addopts = --cov=httpcore --cov=tests --cov-report=term-missing -rxXs +addopts = --cov-report= --cov=httpcore --cov=tests -rxXs markers = copied_from(source, changes=None): mark test as copied from somewhere else, along with a description of changes made to accodomate e.g. our test setup