Skip to content
Snippets Groups Projects
Verified Commit 30ad6200 authored by Antoine R. Dumont's avatar Antoine R. Dumont
Browse files

Drop mock_get_scheduler which creates indirection for no good reason

This is no longer useful, as removing it and tests are still ok.
parent 2ff92ef4
No related branches found
No related tags found
No related merge requests found
......@@ -5,24 +5,6 @@
import os
import pytest
pytest_plugins = ["swh.scheduler.pytest_plugin", "swh.lister.pytest_plugin"]
os.environ["LC_ALL"] = "C.UTF-8"
@pytest.fixture
def mock_get_scheduler(monkeypatch, swh_scheduler):
"""Override the get_scheduler function in swh.lister.core.lister_base, to
return the swh_scheduler fixture.
"""
from swh.lister.core import lister_base
# Match the signature from swh.scheduler.get_scheduler
def get_scheduler(cls, args={}):
return swh_scheduler
monkeypatch.setattr(lister_base, "get_scheduler", get_scheduler)
yield monkeypatch
......@@ -54,9 +54,7 @@ def swh_config(swh_lister_config, monkeypatch, tmp_path):
@pytest.fixture
def swh_lister(
mock_get_scheduler, lister_db_url, swh_scheduler, lister_under_test, swh_config
):
def swh_lister(lister_db_url, swh_scheduler, lister_under_test, swh_config):
assert lister_under_test in SUPPORTED_LISTERS
lister = get_lister(lister_under_test, db_url=lister_db_url)
initialize(create_engine(lister_db_url), drop_tables=True)
......
......@@ -19,7 +19,7 @@ def test_get_lister_wrong_input():
assert "Invalid lister" in str(e.value)
def test_get_lister(mock_get_scheduler):
def test_get_lister():
"""Instantiating a supported lister should be ok
"""
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment