Skip to content

softwareone-platform/pytest-capsqlalchemy

Repository files navigation

pytest-capsqlalchemy

Release PyPI - Python Version Build status Quality Gate Status Coverage Commit activity License

Pytest plugin to allow capturing SQLAlchemy queries.

Getting Started

1. Clone the repository

First, clone the repository from GitHub:

git clone https://github.com/softwareone-platform/pytest-capsqlalchemy

2. Set Up Your Development Environment

Then, install the environment and the pre-commit hooks with

make install

This will also generate your uv.lock file

3. Run the pre-commit hooks

Initially, the CI/CD pipeline might be failing due to formatting issues. To resolve those run:

uv run pre-commit run -a

4. Run the tests

The 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 -d

And after that to run the tests:

make test

5. Commit the changes

Lastly, commit the changes made by the two steps above to your repository.

git add .
git commit -m 'Fix formatting issues'
git push origin main

You 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.

About

Pytest plugin to allow capturing SQLAlchemy queries.

Resources

License

Contributing

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •