starlette/scripts/test

20 lines
576 B
Plaintext
Raw Normal View History

2018-06-25 13:15:32 +00:00
#!/bin/sh -e
export PREFIX=""
if [ -d 'venv' ] ; then
export PREFIX="venv/bin/"
fi
export VERSION_SCRIPT="import sys; print('%s.%s' % sys.version_info[0:2])"
export PYTHON_VERSION=`python -c "$VERSION_SCRIPT"`
2018-06-25 13:15:32 +00:00
set -x
PYTHONPATH=. ${PREFIX}pytest --ignore venv --cov=starlette --cov=tests --cov-fail-under=100 --cov-report=term-missing ${@}
${PREFIX}mypy starlette --ignore-missing-imports
if [ "${PYTHON_VERSION}" = '3.7' ]; then
echo "Skipping 'black' on 3.7. See issue https://github.com/ambv/black/issues/494"
else
${PREFIX}black starlette tests --check
fi