diff --git a/MANIFEST.in b/MANIFEST.in index 1a35fb1..49f5cb8 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,5 +1,5 @@ include Makefile include requirements*.txt include version.txt -recursive-include swh/loader/mercurial/tests/resources * +recursive-include swh/loader/mercurial/tests/data * recursive-include swh py.typed diff --git a/swh/loader/mercurial/tests/conftest.py b/swh/loader/mercurial/tests/conftest.py index 46785c6..db3ac64 100644 --- a/swh/loader/mercurial/tests/conftest.py +++ b/swh/loader/mercurial/tests/conftest.py @@ -1,72 +1,63 @@ # Copyright (C) 2019-2020 The Software Heritage developers # See the AUTHORS file at the top-level directory of this distribution # License: GNU General Public License version 3, or any later version # See top-level LICENSE file for more information import os import yaml import pytest from typing import Any, Dict from swh.scheduler.tests.conftest import * # noqa from swh.storage.tests.conftest import * # noqa @pytest.fixture def swh_loader_config(swh_storage_backend_config, tmp_path) -> Dict[str, Any]: swh_storage_backend_config["journal_writer"] = {} return { "storage": { "cls": "pipeline", "steps": [ {"cls": "filter"}, { "cls": "buffer", "min_batch_size": { "content": 10000, "content_bytes": 1073741824, "directory": 2500, "revision": 10, "release": 100, }, }, swh_storage_backend_config, ], }, "bundle_filename": "HG20_none_bundle", "cache1_size": 838860800, "cache2_size": 838860800, "clone_timeout_seconds": 2 * 3600, "reduce_effort": False, "save_data": False, "save_data_path": "", "max_content_size": 104857600, "temp_directory": str(tmp_path), } @pytest.fixture def swh_config(swh_loader_config, monkeypatch, tmp_path): conffile = os.path.join(str(tmp_path), "loader.yml") with open(conffile, "w") as f: f.write(yaml.dump(swh_loader_config)) monkeypatch.setenv("SWH_CONFIG_FILENAME", 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 def celery_includes(): return [ "swh.loader.mercurial.tasks", ] diff --git a/swh/loader/mercurial/tests/resources/hello.tgz b/swh/loader/mercurial/tests/data/hello.tgz similarity index 100% rename from swh/loader/mercurial/tests/resources/hello.tgz rename to swh/loader/mercurial/tests/data/hello.tgz diff --git a/swh/loader/mercurial/tests/resources/the-sandbox.tgz b/swh/loader/mercurial/tests/data/the-sandbox.tgz similarity index 100% rename from swh/loader/mercurial/tests/resources/the-sandbox.tgz rename to swh/loader/mercurial/tests/data/the-sandbox.tgz diff --git a/swh/loader/mercurial/tests/resources/transplant.tgz b/swh/loader/mercurial/tests/data/transplant.tgz similarity index 100% rename from swh/loader/mercurial/tests/resources/transplant.tgz rename to swh/loader/mercurial/tests/data/transplant.tgz