* Enforce coverage when running tests
* Enforce test coverage
run: "scripts/build"
- name: "Run tests"
run: "scripts/test"
+ - name: "Enforce coverage"
+ run: "scripts/coverage"
--- /dev/null
+#!/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
set -ex
${PREFIX}pytest $@
+
+if [ -z $GITHUB_ACTIONS ]; then
+ scripts/coverage
+fi
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