Install the tests
dev-dependencies:
pdm install -dG tests
Run the unit and spec tests together:
pdm run test
Run the unit tests:
pdm run unit
Recap has spec validation tests that validate Recap various Recap schemas against Recap's type spec. These tests are located in the tests/spec
directory.
Run the spec tests:
pdm run spec
These tests require internet access because they download the spec from Recap's website.
Recap has integration tests that validate some of Recap's readers against real systems. These tests are located in the tests/integration
directory.
These tests require a postgres and mysql database to be running to work. To spin them up, you can use docker-compose:
docker-compose --project-directory tests/ up
Run the integration tests:
RECAP_URLS='["postgresql://postgres:password@localhost:5432/testdb"]' pdm run integration
These test require various systems to be running as defined in the .github/workflows/ci.yml file.
Install the style
dev-dependencies:
pdm install -dG style
Recap does style checks, formatting, linting, and type hint checks with:
Recap uses for code formatting and for import sorting.
Format the code with:
pdm run style
Run individually with:
pdm run black recap/ tests/
pdm run isort recap/ tests/
pdm run autoflake --in-place --remove-unused-variables --remove-all-unused-imports --recursive recap/ tests/
If just want to see what will be formatted without changing anything:
pdm run black --check --diff recap/ tests/
pdm run isort --check --diff recap/ tests/
pdm run autoflake --check-diff --remove-unused-variables --remove-all-unused-imports --recursive recap/ tests/
Run linting:
pdm run pylint --fail-under=7.0 recap/ tests/
Run type checks:
pdm run pyright