Skip to main content

Use a temporary PostgreSQL database with pytest-django

Project description

Use case

This pytest plugin can be used to test a Django application that uses PostgreSQL. It leverages the testing.postgresql module to setup a temporary PostgreSQL database server and injects the configuration for it into Django’s settings. It is intended to be used together with pytest-django.


testing.postgresql needs the postgresql server binary available.

How to use

To use, simply install the package in your testing environment and laod the django-testing-psotgresql plugin when running pytest (pytest normally auto-discovers it).

The plugin re-uses the configuration used by pytest-django.


Right now, this plugin can only reconfigure the default database.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for pytest-django-testing-postgresql, version 0.1.post0
Filename, size File type Python version Upload date Hashes
Filename, size pytest_django_testing_postgresql-0.1.post0-py3-none-any.whl (3.6 kB) File type Wheel Python version 3.7 Upload date Hashes View
Filename, size pytest-django-testing-postgresql-0.1.post0.tar.gz (2.9 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page