Enforce coverage (#955)

* Enforce coverage when running tests

* Enforce test coverage
This commit is contained in:
Tom Christie 2020-05-15 16:17:33 +01:00 committed by GitHub
parent 51b70b3fca
commit 0a8b0c65bd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 18 additions and 1 deletions

View File

@ -29,3 +29,5 @@ jobs:
run: "scripts/build"
- name: "Run tests"
run: "scripts/test"
- name: "Enforce coverage"
run: "scripts/coverage"

11
scripts/coverage Executable file
View File

@ -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=97

View File

@ -22,3 +22,7 @@ fi
set -ex
${PREFIX}pytest $@
if [ -z $GITHUB_ACTIONS ]; then
scripts/coverage
fi

View File

@ -16,6 +16,6 @@ line_length = 88
multi_line_output = 3
[tool:pytest]
addopts = --cov=httpx --cov=tests --cov-report=term-missing -rxXs
addopts = --cov=httpx --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