-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
testing
RayBB edited this page Mar 1, 2026
·
2 revisions
This guide covers running and writing tests for the Open Library project.
docker compose run --rm home make testdocker compose run --rm home pytestRun a specific test file:
docker compose run --rm home pytest openlibrary/plugins/importapi/tests/test_import_validator.pyRun tests matching a pattern:
docker compose run --rm home pytest -k "test_name_pattern"docker compose run --rm home npm run testdocker compose run --rm home make mypyOpen Library uses automated linting to maintain code quality and consistency. The CI server automatically checks all pull requests for linting issues. To save time, you can run these checks locally before pushing your changes.
| Task | Command |
|---|---|
| Run all linters | docker compose run --rm home make lint |
| Lint JavaScript | docker compose run --rm home npm run lint |
| Lint Python | docker compose run --rm home make lint |
| Run pre-commit hooks | pre-commit run --all-files |
| Bypass pre-commit | git commit --no-verify |
For details on setting up and troubleshooting pre-commit, see the Pre-Commit Guide.