Start an ephemeral postgres instance for easy testing
Project description
ephemeral-postgres
ephemeral-postgres is a python package for easily setting up, testing, and finally tearing down postgres instances. It can be easily integrated in most test suites but has been primarily used with pytest.
Installation
pip install ephemeral-postgres
Example
import ephemeral_postgres
import psycopg2
with ephemeral_postgres.postgres() as uri:
con = psycopg2.connect(uri)
cur = con.cursor()
cur.execute('select * from pg_database')
for row in cur.fetchall():
print(row)
Developing
pip install -e .[test]
# run unit tests
pytest
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.