userver: samples/digest_auth_service/tests/conftest.py
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages Concepts
samples/digest_auth_service/tests/conftest.py
1import pytest
2
3from testsuite.databases.pgsql import discover
4
5pytest_plugins = ['pytest_userver.plugins.postgresql']
6
7
8@pytest.fixture(scope='session')
9def initial_data_path(service_source_dir):
10 """Path for find files with data"""
11 return [service_source_dir / 'postgresql/data']
12
13
14@pytest.fixture(scope='session')
15def pgsql_local(service_source_dir, pgsql_local_create):
16 """Create schemas databases for tests"""
17 databases = discover.find_schemas(
18 'auth',
19 [service_source_dir.joinpath('postgresql/schemas')],
20 )
21 return pgsql_local_create(list(databases.values()))
22
23
24@pytest.fixture(scope='session')
25def service_env():
26 return {
27 'SERVER_DIGEST_AUTH_SECRET': ('{ "http_server_digest_auth_secret": "some-private-key" }'),
28 }