Skip to content

Commit 8aad8da

Browse files
ilyazubDimitry
and
Dimitry
committed
perf: run pytest in parallel
Sample output: platform linux -- Python 3.10.9, pytest-7.2.1, pluggy-1.0.0 rootdir: /home/ilyazub/Workspace/google-search-results-python plugins: parallel-0.1.1 collected 48 pytest-parallel: 8 workers (processes), 6 tests per worker (threads) `py` dependency is used because pytest-parallel depends on it but doesn't require 😕 kevlened/pytest-parallel#118 Co-authored-by: Dimitry <[email protected]>
1 parent b0771f4 commit 8aad8da

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

Makefile

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,27 +12,31 @@ clean:
1212
find . -type d -name "__pycache__" -delete
1313
pip3 uninstall google_search_results
1414

15+
create_env:
16+
python -m venv .env
17+
source .env/bin/activate
18+
1519
install:
1620
python3 -m pip install --upgrade pip
1721
if [ -f requirements.txt ]; then pip3 install -r requirements.txt; fi
1822

19-
lint:
23+
lint: build_dep
2024
# stop the build if there are Python syntax errors or undefined names
2125
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
2226
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
2327
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
2428

2529
# Test with Python 3
26-
test:
27-
pytest
30+
test: build_dep
31+
pytest --workers auto --tests-per-worker auto
2832

2933
# run example only
3034
# and display output (-s)
3135
example:
3236
pytest -s "tests/test_example.py::TestExample::test_async"
3337

3438
build_dep:
35-
pip3 install -U setuptools pytest flake8
39+
pip3 install -U setuptools pytest py pytest-parallel flake8
3640

3741
# https://packaging.python.org/tutorials/packaging-projects/
3842
build:

0 commit comments

Comments
 (0)