Skip to content

Commit

Permalink
➕ Bring back pytest-cov because coverage can't detect pytest-xdist
Browse files Browse the repository at this point in the history
  • Loading branch information
tiangolo committed Nov 5, 2022
1 parent 107e9b4 commit f694225
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ Documentation = "https://typer.tiangolo.com/"
test = [
"shellingham >=1.3.0,<2.0.0",
"pytest >=4.4.0,<5.4.0",
"coverage >=5.2,<7.0",
"pytest-cov >=2.10.0,<5.0.0",
"coverage >=6.2,<7.0",
"pytest-xdist >=1.32.0,<2.0.0",
"pytest-sugar >=0.9.4,<0.10.0",
"mypy ==0.910",
Expand Down
5 changes: 1 addition & 4 deletions scripts/test-cov-html.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,4 @@
set -e
set -x

bash scripts/test.sh ${@}
coverage combine
coverage report --show-missing
coverage html
bash scripts/test.sh --cov-report=html ${@}
2 changes: 1 addition & 1 deletion scripts/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ export TERMINAL_WIDTH=3000
export _TYPER_FORCE_DISABLE_TERMINAL=1
bash ./scripts/test-files.sh
# Use xdist-pytest --forked to ensure modified sys.path to import relative modules in examples keeps working
coverage run -m pytest -o console_output_style=progress --forked --numprocesses=auto ${@}
pytest --cov=typer --cov=tests --cov=docs_src --cov-report=term-missing -o console_output_style=progress --forked --numprocesses=auto ${@}

0 comments on commit f694225

Please sign in to comment.