From f9ef711fd63182526e93c7d70d03650b7ba0f0fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Ram=C3=ADrez?= Date: Sat, 5 Nov 2022 02:02:13 +0100 Subject: [PATCH] =?UTF-8?q?=E2=9E=95=20Bring=20back=20pytest-cov=20because?= =?UTF-8?q?=20coverage=20can't=20detect=20pytest-xdist=20(#484)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/test.yml | 4 ++-- pyproject.toml | 7 ++++--- scripts/test-cov-html.sh | 5 +---- scripts/test.sh | 2 +- 4 files changed, 8 insertions(+), 10 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 4c2044324..f960056ef 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -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: diff --git a/pyproject.toml b/pyproject.toml index 3fc602b9b..15e100bb7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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", diff --git a/scripts/test-cov-html.sh b/scripts/test-cov-html.sh index d1bdfced2..7957277fc 100755 --- a/scripts/test-cov-html.sh +++ b/scripts/test-cov-html.sh @@ -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 ${@} diff --git a/scripts/test.sh b/scripts/test.sh index 40e7a3f55..84b6e305a 100755 --- a/scripts/test.sh +++ b/scripts/test.sh @@ -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 ${@}