Testing¶
Shopyo uses pytest for its test suite. Quality software requires testing; don’t break the build.
Running Tests¶
You should run tests from the project root directory.
Standard run:
$ pytestVerbose run:
$ pytest -v
Specific test file:
$ pytest shopyo/api/tests/test_cli.py
Continuous Integration (Tox)¶
We use tox to verify compatibility across multiple Python versions (currently supporting 3.8 up to 3.13).
Run all environments:
$ toxRun specific environment (e.g., Python 3.11):
$ tox -e py311
Coverage Reports¶
To assess how much of the code is covered by tests, use pytest-cov.
Install requirements:
$ pip install -r requirements/tests.txt
Generate report:
$ pytest --cov=shopyo
HTML report:
$ pytest --cov=shopyo --cov-report=html $ python -m http.server 8000 --directory htmlcov