Changeset View
Changeset View
Standalone View
Standalone View
swh/storage/tests/conftest.py
Show All 32 Lines | |||||
settings.register_profile("fast", max_examples=5, deadline=5000) | settings.register_profile("fast", max_examples=5, deadline=5000) | ||||
settings.register_profile("slow", max_examples=20, deadline=5000) | settings.register_profile("slow", max_examples=20, deadline=5000) | ||||
@pytest.fixture | @pytest.fixture | ||||
def swh_storage(postgresql_proc, swh_storage_postgresql): | def swh_storage(postgresql_proc, swh_storage_postgresql): | ||||
storage_config = { | storage_config = { | ||||
'cls': 'local', | 'cls': 'local', | ||||
'args': { | |||||
'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': { | 'objstorage': { | ||||
'cls': 'memory', | 'cls': 'memory', | ||||
'args': {} | 'args': {} | ||||
}, | }, | ||||
'journal_writer': { | 'journal_writer': { | ||||
'cls': 'memory', | 'cls': 'memory', | ||||
}, | }, | ||||
}, | |||||
} | } | ||||
storage = swh.storage.get_storage(**storage_config) | storage = swh.storage.get_storage(**storage_config) | ||||
return storage | return storage | ||||
@pytest.fixture | @pytest.fixture | ||||
def swh_contents(swh_storage): | def swh_contents(swh_storage): | ||||
contents = gen_contents(n=20) | contents = gen_contents(n=20) | ||||
▲ Show 20 Lines • Show All 205 Lines • Show Last 20 Lines |