From f6942255d391b60bc5f5047cd33f0aac83c05a91 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Ram=C3=ADrez?= Date: Sat, 5 Nov 2022 01:34:09 +0100 Subject: [PATCH 1/4] =?UTF-8?q?=E2=9E=95=20Bring=20back=20pytest-cov=20bec?= =?UTF-8?q?ause=20coverage=20can't=20detect=20pytest-xdist?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pyproject.toml | 3 ++- scripts/test-cov-html.sh | 5 +---- scripts/test.sh | 2 +- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 3fc602b9b..2b70f4e9c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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", 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..1d375c125 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 --forked --numprocesses=auto ${@} From 29305b5beab257e13912cb9b58a010d1984bc022 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Ram=C3=ADrez?= Date: Sat, 5 Nov 2022 01:41:17 +0100 Subject: [PATCH 2/4] =?UTF-8?q?=F0=9F=94=A7=20Make=20sure=20Click=207=20ru?= =?UTF-8?q?ns=20have=20their=20own=20coverage?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 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: From 3b56695c72e19d2eff12eed3ea4ac08d4eb6fb35 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Ram=C3=ADrez?= Date: Sat, 5 Nov 2022 01:48:38 +0100 Subject: [PATCH 3/4] =?UTF-8?q?=E2=AC=86=EF=B8=8F=20Upgrade=20pytest=20and?= =?UTF-8?q?=20plugin=20versions?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pyproject.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 2b70f4e9c..15e100bb7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -38,10 +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", + "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,<2.0.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", From c9ca856dee3f9e7d0fd23cfa2c008a5bec90673d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Ram=C3=ADrez?= Date: Sat, 5 Nov 2022 01:57:08 +0100 Subject: [PATCH 4/4] =?UTF-8?q?=F0=9F=94=A7=20Update=20pytest-xdist=20conf?= =?UTF-8?q?ig?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/test.sh b/scripts/test.sh index 1d375c125..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 -pytest --cov=typer --cov=tests --cov=docs_src --cov-report=term-missing -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 ${@}