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

DEV: Use pytest-xdist #2254

Merged
merged 9 commits into from
Oct 17, 2023
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion .github/workflows/github-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
14 changes: 12 additions & 2 deletions requirements/ci-3.11.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions requirements/ci.in
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
15 changes: 13 additions & 2 deletions requirements/ci.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions requirements/dev.txt
Original file line number Diff line number Diff line change
@@ -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
#
Expand Down
Loading