Changeset View
Changeset View
Standalone View
Standalone View
swh/loader/mercurial/tests/conftest.py
Show First 20 Lines • Show All 50 Lines • ▼ Show 20 Lines | |||||
def swh_config(swh_loader_config, monkeypatch, tmp_path): | def swh_config(swh_loader_config, monkeypatch, tmp_path): | ||||
conffile = os.path.join(str(tmp_path), "loader.yml") | conffile = os.path.join(str(tmp_path), "loader.yml") | ||||
with open(conffile, "w") as f: | with open(conffile, "w") as f: | ||||
f.write(yaml.dump(swh_loader_config)) | f.write(yaml.dump(swh_loader_config)) | ||||
monkeypatch.setenv("SWH_CONFIG_FILENAME", conffile) | monkeypatch.setenv("SWH_CONFIG_FILENAME", conffile) | ||||
return conffile | return conffile | ||||
@pytest.fixture | |||||
def datadir(request): | |||||
"""Override default datadir because it's named `resources` in this repository and not | |||||
`data` as expected by the default fixture. | |||||
""" | |||||
return os.path.join(os.path.dirname(str(request.fspath)), "resources") | |||||
@pytest.fixture(scope="session") # type: ignore # expected redefinition | @pytest.fixture(scope="session") # type: ignore # expected redefinition | ||||
def celery_includes(): | def celery_includes(): | ||||
return [ | return [ | ||||
"swh.loader.mercurial.tasks", | "swh.loader.mercurial.tasks", | ||||
] | ] |