userver: samples/postgres_service/tests/conftest.py
⚠️ This is the documentation for an old userver version. Click here to switch to the latest version.
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages Concepts
samples/postgres_service/tests/conftest.py
1# /// [psql prepare]
2import pytest
3
4from testsuite.databases.pgsql import discover
5
6pytest_plugins = ['pytest_userver.plugins.postgresql']
7
8
9@pytest.fixture(scope='session')
10def pgsql_local(service_source_dir, pgsql_local_create):
11 databases = discover.find_schemas(
12 'admin', [service_source_dir.joinpath('schemas/postgresql')],
13 )
14 return pgsql_local_create(list(databases.values()))
15 # /// [psql prepare]