Changeset View
Changeset View
Standalone View
Standalone View
swh/storage/pytest_plugin.py
Show All 23 Lines | |||||
environ["LC_ALL"] = "C.UTF-8" | environ["LC_ALL"] = "C.UTF-8" | ||||
DUMP_FILES = path.join(SQL_DIR, "*.sql") | DUMP_FILES = path.join(SQL_DIR, "*.sql") | ||||
@pytest.fixture | @pytest.fixture | ||||
def swh_storage_backend_config(postgresql_proc, swh_storage_postgresql): | def swh_storage_backend_config(postgresql_proc, swh_storage_postgresql): | ||||
"""Basic pg storage configuration with no journal collaborator | |||||
(to avoid pulling optional dependency on clients of this fixture) | |||||
""" | |||||
yield { | yield { | ||||
"cls": "local", | "cls": "local", | ||||
"db": "postgresql://{user}@{host}:{port}/{dbname}".format( | "db": "postgresql://{user}@{host}:{port}/{dbname}".format( | ||||
host=postgresql_proc.host, | host=postgresql_proc.host, | ||||
port=postgresql_proc.port, | port=postgresql_proc.port, | ||||
user="postgres", | user="postgres", | ||||
dbname="tests", | dbname="tests", | ||||
), | ), | ||||
"objstorage": {"cls": "memory", "args": {}}, | "objstorage": {"cls": "memory", "args": {}}, | ||||
"journal_writer": {"cls": "memory",}, | |||||
} | } | ||||
@pytest.fixture | @pytest.fixture | ||||
def swh_storage(swh_storage_backend_config): | def swh_storage(swh_storage_backend_config): | ||||
return get_storage(cls="validate", storage=swh_storage_backend_config) | return get_storage(cls="validate", storage=swh_storage_backend_config) | ||||
▲ Show 20 Lines • Show All 159 Lines • Show Last 20 Lines |