Skip to content
Snippets Groups Projects
Verified Commit d48e1fd2 authored by Nik | Klampfradler's avatar Nik | Klampfradler
Browse files

Move configuration to pytest hook.

parent b0a6149f
No related branches found
No related tags found
No related merge requests found
from dj_database_url import parse
from django.conf import settings
import pytest
from testing.postgresql import Postgresql
_postgresql = Postgresql()
django.settings.DATABASES['default'] = parse(_postgresql.url())
@pytest.hookimpl(tryfirst=True)
def pytest_load_initial_conftests(early_config, parser, args):
_postgresql = Postgresql()
settings.configure(DATABASES={'default': parse(_postgresql.url())})
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment