No project description provided
Project description
pytest-django-docker-pg
Starts a dockerized postgresql instance in pytest hook allowing pytest_django
tests, for example, to be run against it.
How to use
[tool.pytest.ini_options]
addopts = "-p pytest_django_docker_pg --django-docker-pg-image=postgres:16-alpine "
# settings.py
import os
DATABASES = {
"default": {
"ENGINE": "django.db.backends.postgresql",
"NAME": os.getenv("DB_NAME", "postgres"),
"USER": os.getenv("DB_USER", "postgres"),
"PASSWORD": os.getenv("DB_PASSWORD", "secret"),
"HOST": os.getenv("DB_HOST", "localhost"),
"PORT": os.getenv("DB_PORT", "5432"),
}
}
The default timeout to start a postgres container is 30 seconds.
Can be adjusted in the PYTEST_DJANGO_DOCKER_PG_CONTAINER_TIMEOUT
environment variable
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for pytest_django_docker_pg-0.0.4.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 74b162c283e5bf998de9302c67c59705e531a65b59d4c45e4cee4404386de29a |
|
MD5 | 6dd07ecc4d1d62ead72a7d7915e2b4a2 |
|
BLAKE2b-256 | 456d5e6f66d0b9648e43275bb7ba006d1995903815aa73e0f7725124ee627145 |
Close
Hashes for pytest_django_docker_pg-0.0.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fa153b1323cf128308d1079f11426841ad0d95c959a721a3834b04c5d778121c |
|
MD5 | f6e29a72394b640e0030f82f0d3f0f68 |
|
BLAKE2b-256 | 72bca70f46ceef1994e438004103d74e34e829c49868540d7e23a36c18ee0860 |