schireson / pytest-mock-resources

Pytest Fixtures that let you actually test against external resource (Postgres, Mongo, Redshift...) dependent code.
https://pytest-mock-resources.readthedocs.io/en/latest/quickstart.html
MIT License
179 stars 19 forks source link

feat: Add configurable template option for postgres database creation. #135

Closed DanCardin closed 2 years ago

DanCardin commented 2 years ago

Using the default template1 can cause issues if you're testing code which connects to template1. By enabling a configurable template, such tests can make use of template0 (or any other template).

Sidebar, theoretically postgres' template feature (we could create our own template database for example) could allow us to create a canonical template once (per fixture, say) and save the cost of creating large sets of tables or input data