Skip to content

Commit

Permalink
Run unittests in parallel using unittest-parallel. (hhursev#488)
Browse files Browse the repository at this point in the history
  • Loading branch information
hhursev authored Jan 30, 2022
1 parent 9b6b063 commit b9d897f
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/unittests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
pip install -r requirements-dev.txt
- name: Unittest and Coverage Report
run: |
coverage run -m unittest
python run_tests.py
- name: coveralls.io
uses: AndreMiras/coveralls-python-action@develop
with:
Expand Down
5 changes: 2 additions & 3 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ If you want a scraper for a new site added
For Devs / Contribute
---------------------

Assuming you have ``python3`` installed, navigate to the directory where you want this project to live in and drop these lines
Assuming you have ``>=python3.7`` installed, navigate to the directory where you want this project to live in and drop these lines

.. code:: shell
Expand All @@ -302,8 +302,7 @@ Assuming you have ``python3`` installed, navigate to the directory where you wan
source .venv/bin/activate &&
pip install -r requirements-dev.txt &&
pre-commit install &&
python -m coverage run -m unittest &&
python -m coverage report
python run_tests
In case you want to run a single unittest for a newly developed scraper

Expand Down
2 changes: 1 addition & 1 deletion requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ flake8>=3.8.3
flake8-printf-formatting>=1.1.0
pre-commit>=2.6.0
pytest>=6.1.1

unittest-parallel>=1.5.0
# language-tags>=1.0.0
# tld>=0.12.3
7 changes: 7 additions & 0 deletions run_tests.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import subprocess

if __name__ == "__main__":
run_tests_command = (
"unittest-parallel -t . -s tests --coverage --coverage-rcfile .coveragerc"
)
subprocess.run(run_tests_command.split(" "), check=True, text=True)

0 comments on commit b9d897f

Please sign in to comment.