Skip to content

Commit

Permalink
➕ Bring back pytest-cov because coverage can't detect pytest-xdist (t…
Browse files Browse the repository at this point in the history
  • Loading branch information
tiangolo authored and alexreg committed Nov 9, 2022
1 parent 4c89b76 commit d96ee55
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 7 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Expand Up @@ -28,8 +28,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
1 change: 1 addition & 0 deletions pyproject.toml
Expand Up @@ -53,6 +53,7 @@ test = [
"isort ~= 5.10.1",
"mypy ~= 0.950",
"pytest ~= 7.1.2",
"pytest-cov ~= 3.0.0",
"pytest-sugar ~= 0.9.4",
"pytest-xdist ~= 2.1.0",
"shellingham ~= 1.4.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 @@ -5,4 +5,4 @@ set -x

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 d96ee55

Please sign in to comment.