#!/usr/bin/env bash set -e set -x coverage run -m pytest tests/ coverage report # The HTML report is a convenience: a container run can leave htmlcov/ owned by # root, and failing here after a green suite reads like a test failure. `make # clean` is no way out of that one — removing the files inside a directory # needs write permission on it, which is the permission that is missing. coverage html --title "${@-coverage}" \ || echo " ! coverage html failed — tests passed (htmlcov/ root-owned? sudo rm -rf htmlcov)" >&2