diff --git a/.github/workflows/github-ci.yaml b/.github/workflows/github-ci.yaml index 12cd35c86..236a0446e 100644 --- a/.github/workflows/github-ci.yaml +++ b/.github/workflows/github-ci.yaml @@ -91,7 +91,9 @@ jobs: python -c "from tests import download_test_pdfs; download_test_pdfs()" - name: Test with pytest run: | - python -m coverage run --parallel-mode -m pytest tests -vv + python -m pytest tests --cov=pypdf --cov-append -n auto -vv + - name: Rename coverage data file + run: mv .coverage ".coverage.$RANDOM" - name: Upload coverage data uses: actions/upload-artifact@v3 with: @@ -170,6 +172,16 @@ jobs: with: name: coverage-data + - name: Check Number of Downloaded Files + run: | + downloaded_files_count=$(find \.coverage* -type f | wc -l) + if [ $downloaded_files_count -eq 7 ]; then + echo "The expected number of files (7) were downloaded." + else + echo "ERROR: Expected 7 files, but found $downloaded_files_count files." + exit 1 + fi + - name: Combine coverage & create xml report run: | python -m coverage combine diff --git a/pyproject.toml b/pyproject.toml index 1412b5e90..6d3021745 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -51,7 +51,7 @@ crypto = [ "PyCryptodome; python_version == '3.6'", ] image = ["Pillow>=8.0.0"] -dev = ["black", "pip-tools", "pre-commit<2.18.0", "pytest-cov", "pytest-socket", "pytest-timeout", "flit", "wheel"] +dev = ["black", "pip-tools", "pre-commit<2.18.0", "pytest-cov", "pytest-socket", "pytest-timeout", "flit", "wheel", "pytest-xdist"] docs = ["sphinx", "sphinx_rtd_theme", "myst_parser"] [tool.mutmut] diff --git a/requirements/ci-3.11.txt b/requirements/ci-3.11.txt index a803a5c4f..33143f5cd 100644 --- a/requirements/ci-3.11.txt +++ b/requirements/ci-3.11.txt @@ -6,8 +6,12 @@ # attrs==23.1.0 # via flake8-bugbear -coverage==7.3.0 - # via -r requirements/ci.in +coverage[toml]==7.3.0 + # via + # -r requirements/ci.in + # pytest-cov +execnet==2.0.2 + # via pytest-xdist flake8==6.1.0 # via # -r requirements/ci.in @@ -51,14 +55,20 @@ pytest==7.4.0 # via # -r requirements/ci.in # pytest-benchmark + # pytest-cov # pytest-socket # pytest-timeout + # pytest-xdist pytest-benchmark==4.0.0 # via -r requirements/ci.in +pytest-cov==4.1.0 + # via -r requirements/ci.in pytest-socket==0.6.0 # via -r requirements/ci.in pytest-timeout==2.1.0 # via -r requirements/ci.in +pytest-xdist==3.3.1 + # via -r requirements/ci.in ruff==0.0.290 # via -r requirements/ci.in typeguard==4.1.2 diff --git a/requirements/ci.in b/requirements/ci.in index a84af3881..ff071d125 100644 --- a/requirements/ci.in +++ b/requirements/ci.in @@ -11,6 +11,8 @@ pytest pytest-benchmark pytest-socket pytest-timeout +pytest-xdist +pytest-cov # ruff # only take this for 3.11 typeguard types-dataclasses diff --git a/requirements/ci.txt b/requirements/ci.txt index ab29f9d92..0d2814426 100644 --- a/requirements/ci.txt +++ b/requirements/ci.txt @@ -9,8 +9,12 @@ attrs==20.3.0 # flake8-bugbear # flake8-implicit-str-concat # pytest -coverage==6.2 - # via -r requirements/ci.in +coverage[toml]==6.2 + # via + # -r requirements/ci.in + # pytest-cov +execnet==1.9.0 + # via pytest-xdist flake8==5.0.4 # via # -r requirements/ci.in @@ -65,18 +69,25 @@ pytest==7.0.1 # via # -r requirements/ci.in # pytest-benchmark + # pytest-cov # pytest-socket # pytest-timeout + # pytest-xdist pytest-benchmark==3.4.1 # via -r requirements/ci.in +pytest-cov==4.0.0 + # via -r requirements/ci.in pytest-socket==0.4.1 # via -r requirements/ci.in pytest-timeout==2.1.0 # via -r requirements/ci.in +pytest-xdist==3.0.2 + # via -r requirements/ci.in six==1.16.0 # via flake8-print tomli==1.2.3 # via + # coverage # mypy # pytest typed-ast==1.5.5 diff --git a/requirements/dev.txt b/requirements/dev.txt index 39aca2733..edab7dd28 100644 --- a/requirements/dev.txt +++ b/requirements/dev.txt @@ -1,6 +1,6 @@ # -# This file is autogenerated by pip-compile with python 3.7 -# To update, run: +# This file is autogenerated by pip-compile with Python 3.7 +# by the following command: # # pip-compile requirements/dev.in #