3from testsuite.databases.pgsql
import discover
5pytest_plugins = [
'pytest_userver.plugins.postgresql']
7USERVER_CONFIG_HOOKS = [
'userver_actions_service']
10@pytest.fixture(scope='session')
11def initial_data_path(service_source_dir):
12 """Path for find files with data"""
13 return [service_source_dir /
'postgresql/data']
16@pytest.fixture(scope='session')
17def userver_actions_service(mockserver_info):
18 def do_patch(config_yaml, config_vars):
19 components = config_yaml[
'components_manager'][
'components']
20 components[
'action-client'][
'service-url'] = mockserver_info.url(
27@pytest.fixture(scope='session')
28def pgsql_local(service_source_dir, pgsql_local_create):
29 """Create schemas databases for tests"""
30 databases = discover.find_schemas(
31 'pg_service_template',
32 [service_source_dir.joinpath(
'postgresql/schemas')],
34 return pgsql_local_create(list(databases.values()))