Pytest plugin to allow capturing SQLAlchemy queries.
- Github repository: https://github.com/softwareone-platform/pytest-capsqlalchemy/
- Documentation https://softwareone-platform.github.io/pytest-capsqlalchemy/
First, clone the repository from GitHub:
git clone https://github.com/softwareone-platform/pytest-capsqlalchemyThen, install the environment and the pre-commit hooks with
make installThis will also generate your uv.lock file
Initially, the CI/CD pipeline might be failing due to formatting issues. To resolve those run:
uv run pre-commit run -aThe tests require a Postgres database to be running. If you prefer to use a local database you need to edit the .env file with
the connection options for it. Alternatively, you can use the provided docker-compose.yaml to run it within docker -- all you
need to do is run:
docker compose up test_postgres -dAnd after that to run the tests:
make testLastly, commit the changes made by the two steps above to your repository.
git add .
git commit -m 'Fix formatting issues'
git push origin mainYou are now ready to start development on your project! The CI/CD pipeline will be triggered when you open a pull request, merge to main, or when you create a new release.
To finalize the set-up for publishing to PyPI, see here. For activating the automatic documentation with MkDocs, see here.