🔧 Update tests tools

This commit is contained in:
Sebastián Ramírez 2020-01-05 20:50:14 +01:00
parent 44319119e9
commit 5d7eb2285d
3 changed files with 16 additions and 3 deletions

View file

@ -40,6 +40,8 @@ test = [
"pytest >=4.0.0",
"pytest-cov",
"coverage",
"pytest-xdist",
"pytest-sugar",
"mypy",
"black",
"isort"

10
scripts/test-files.sh Executable file
View file

@ -0,0 +1,10 @@
#!/usr/bin/env bash
set -e
set -x
# Check README.md is up to date
diff --brief docs/index.md README.md
# Check copy paste errors in tutorials
if grep -r --include "*.md" "Usage: tutorial" ./docs ; then echo "Incorrect console demo"; exit 1 ; fi
if grep -r --include "*.md" "python tutorial" ./docs ; then echo "Incorrect console demo"; exit 1 ; fi

View file

@ -4,7 +4,8 @@ set -e
set -x
export PYTHONPATH=./docs/src
pytest --cov=typer --cov=tests --cov=docs/src --cov-report=term-missing ${@}
# Use xdist-pytest --forked to ensure modified sys.path to import relative modules in examples keeps working
pytest --cov=typer --cov=tests --cov=docs/src --cov-report=term-missing -o console_output_style=progress --forked --numprocesses=auto ${@}
bash ./scripts/lint.sh
# Check README.md is up to date
diff --brief docs/index.md README.md
# Include tests for files
bash ./scripts/test-files.sh