Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

➕ Bring back pytest-cov because coverage can't detect pytest-xdist #484

Merged
merged 4 commits into from Nov 5, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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 ${@}