diff --git a/swh/storage/pytest_plugin.py b/swh/storage/pytest_plugin.py --- a/swh/storage/pytest_plugin.py +++ b/swh/storage/pytest_plugin.py @@ -58,7 +58,7 @@ @pytest.fixture def swh_storage(swh_storage_backend_config): - return get_storage(cls="validate", storage=swh_storage_backend_config) + return get_storage(swh_storage_backend_config) # the postgres_fact factory fixture below is mostly a copy of the code diff --git a/swh/storage/tests/conftest.py b/swh/storage/tests/conftest.py --- a/swh/storage/tests/conftest.py +++ b/swh/storage/tests/conftest.py @@ -14,6 +14,7 @@ pytest_cov = None from swh.model.tests.generate_testdata import gen_contents, gen_origins +from swh.storage import get_storage # define tests profile. Full documentation is at: # https://hypothesis.readthedocs.io/en/latest/settings.html#settings-profiles @@ -36,6 +37,19 @@ assert False, "missing pytest_cov.embed.multiprocessing_start?" +@pytest.fixture +def swh_storage_backend_config(swh_storage_backend_config): + """storage should test with its journal writer collaborator on + + """ + yield {**swh_storage_backend_config, "journal_writer": {"cls": "memory",}} + + +@pytest.fixture +def swh_storage(swh_storage_backend_config): + return get_storage(cls="validate", storage=swh_storage_backend_config) + + @pytest.fixture def swh_contents(swh_storage): contents = gen_contents(n=20) @@ -49,11 +63,3 @@ origins = gen_origins(n=100) swh_storage.origin_add(origins) return origins - - -@pytest.fixture -def swh_storage_backend_config(swh_storage_backend_config): - """storage should test with its journal writer collaborator on - - """ - yield {**swh_storage_backend_config, "journal_writer": {"cls": "memory",}}