3
Step 5 Tests and Quality
Tirsvad edited this page 2026-11-20 16:43:11 +01:00

English · Dansk · Bahasa Malaysia

Step 5: Tests and quality

Step 5: run the tests

What we did

python -m pytest
python -m pytest --cov=pdf_to_audiobook
python -m pytest -m slow
python -m ruff check src tests
python -m mypy
doxygen Doxyfile
pwsh scripts/scan.ps1
  • 131 fast tests cover 99 percent of the source. A fixture blocks the network, so no test can reach the internet.
  • ruff checks style, mypy in strict mode checks types, Doxygen builds the API documentation from the comments in the source.
  • scripts/scan.ps1 runs the opengrep security scan before every push, and the host runs it again on every pull request.

What we gained

  • Fakes beat mocks: a small fake engine is easier to read than a mock that records calls.
  • A local scan is not the host's scan: the host used stricter rules and found two things the local rules missed, so we fixed them and added a rule set to the local script.
  • Screenshots are part of the documentation, so a small tool renders real command output as an SVG image without opening a desktop window.