Skip to content

Commit

Permalink
➕ Bring back pytest-cov because coverage can't detect pytest-xdist (#484
Browse files Browse the repository at this point in the history
)
  • Loading branch information
tiangolo committed Nov 5, 2022
1 parent 107e9b4 commit f9ef711
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 10 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Expand Up @@ -36,8 +36,8 @@ jobs:
- name: Test
run: bash scripts/test.sh
env:
COVERAGE_FILE: coverage/.coverage.${{ runner.os }}-py${{ matrix.python-version }}
CONTEXT: ${{ runner.os }}-py${{ matrix.python-version }}
COVERAGE_FILE: coverage/.coverage.${{ runner.os }}-py${{ matrix.python-version }}-click-7-${{ matrix.click-7 }}
CONTEXT: ${{ runner.os }}-py${{ matrix.python-version }}-click-7-${{ matrix.click-7 }}
- name: Store coverage files
uses: actions/upload-artifact@v3
with:
Expand Down
7 changes: 4 additions & 3 deletions pyproject.toml
Expand Up @@ -38,9 +38,10 @@ Documentation = "https://typer.tiangolo.com/"
[tool.flit.metadata.requires-extra]
test = [
"shellingham >=1.3.0,<2.0.0",
"pytest >=4.4.0,<5.4.0",
"coverage >=5.2,<7.0",
"pytest-xdist >=1.32.0,<2.0.0",
"pytest >=4.4.0,<8.0.0",
"pytest-cov >=2.10.0,<5.0.0",
"coverage >=6.2,<7.0",
"pytest-xdist >=1.32.0,<4.0.0",
"pytest-sugar >=0.9.4,<0.10.0",
"mypy ==0.910",
"black >=22.3.0,<23.0.0",
Expand Down
5 changes: 1 addition & 4 deletions scripts/test-cov-html.sh
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
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 --numprocesses=auto ${@}

0 comments on commit f9ef711

Please sign in to comment.