Skip to content

Commit

Permalink
perf($pytest): distribute tests across multiple CPUs to speed up test…
Browse files Browse the repository at this point in the history
  • Loading branch information
johnnymillergh committed Sep 12, 2022
1 parent 223e7ab commit b16b2db
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 2 deletions.
1 change: 1 addition & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
data_file = ./build/.coverage
source = python_boilerplate
omit = python_boilerplate/__main__.py
python_boilerplate/__init__.py
tests/*

[report]
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ repos:
language: system
# https://github.com/pytest-dev/pytest/issues/5502#issuecomment-1020761655
# Prevent Pytest logging error like: ValueError: I/O operation on closed file.
entry: pipenv run pytest --cov --cov-report html --html=./build/.pytest_report/report.html --self-contained-html --log-cli-level=DEBUG
entry: pipenv run pytest --cov --cov-report html --html=./build/.pytest_report/report.html --self-contained-html --log-cli-level=DEBUG -n auto
types: [python]
pass_filenames: false

Expand Down
2 changes: 2 additions & 0 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -62,5 +62,7 @@ pytest-mock = "==3.8.2"
pytest-cov = "==3.0.0"
# Plugin for generating HTML reports for pytest results. https://github.com/pytest-dev/pytest-html/
pytest-html = "==3.1.1"
# pytest xdist plugin for distributed testing and loop-on-failing modes. https://github.com/pytest-dev/pytest-xdist/
pytest-xdist = "==2.5.0"
# Call stack profiler for Python. Shows you why your code is slow! https://github.com/joerick/pyinstrument
pyinstrument = "==4.3.0"
26 changes: 25 additions & 1 deletion Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit b16b2db

Please sign in to comment.