1import pytest
2
3from testsuite.databases.pgsql import discover
4
5pytest_plugins = ['pytest_userver.plugins.postgresql']
6
7USERVER_CONFIG_HOOKS = ['userver_actions_service']
8
9
10@pytest.fixture(scope='session')
11def userver_actions_service(mockserver_info):
12 def do_patch(config_yaml, config_vars):
13 components = config_yaml['components_manager']['components']
14 components['action-client']['service-url'] = mockserver_info.url(
15 '/v1/action',
16 )
17
18 return do_patch
19
20
21@pytest.fixture(scope='session')
22def pgsql_local(db_dump_schema_path, pgsql_local_create):
23 databases = discover.find_schemas('admin', [db_dump_schema_path])
24 return pgsql_local_create(list(databases.values()))