diff --git a/conftest.py b/conftest.py --- a/conftest.py +++ b/conftest.py @@ -12,4 +12,8 @@ settings.register_profile("slow", max_examples=20, deadline=5000) -pytest_plugins = ["swh.scheduler.pytest_plugin", "swh.core.db.pytest_plugin"] +pytest_plugins = [ + "swh.scheduler.pytest_plugin", + "swh.core.db.pytest_plugin", + "swh.storage.pytest_plugin", +] diff --git a/requirements-test.txt b/requirements-test.txt --- a/requirements-test.txt +++ b/requirements-test.txt @@ -3,6 +3,7 @@ celery >= 4.3 hypothesis >= 3.11.0 swh.lister +swh.storage[testing] types-click types-flask types-pyyaml diff --git a/swh/scheduler/tests/test_cli.py b/swh/scheduler/tests/test_cli.py --- a/swh/scheduler/tests/test_cli.py +++ b/swh/scheduler/tests/test_cli.py @@ -18,7 +18,6 @@ from swh.model.model import Origin from swh.scheduler.cli import cli from swh.scheduler.utils import create_task_dict, utcnow -from swh.storage import get_storage CLI_CONFIG = """ scheduler: @@ -597,13 +596,12 @@ @pytest.fixture -def storage(): +def storage(swh_storage): """An instance of in-memory storage that gets injected into the CLI functions.""" - storage = get_storage(cls="memory") with patch("swh.storage.get_storage") as get_storage_mock: - get_storage_mock.return_value = storage - yield storage + get_storage_mock.return_value = swh_storage + yield swh_storage @patch("swh.scheduler.cli.utils.TASK_BATCH_SIZE", 3)