Enforce coverage (#955)
* Enforce coverage when running tests * Enforce test coverage
This commit is contained in:
parent
51b70b3fca
commit
0a8b0c65bd
2
.github/workflows/test-suite.yml
vendored
2
.github/workflows/test-suite.yml
vendored
@ -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
11
scripts/coverage
Executable 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
|
||||
@ -22,3 +22,7 @@ fi
|
||||
set -ex
|
||||
|
||||
${PREFIX}pytest $@
|
||||
|
||||
if [ -z $GITHUB_ACTIONS ]; then
|
||||
scripts/coverage
|
||||
fi
|
||||
|
||||
@ -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
|
||||
|
||||
Loading…
Reference in New Issue
Block a user