Changeset View
Standalone View
swh/loader/tests/conftest.py
# Copyright (C) 2019 The Software Heritage developers | # Copyright (C) 2019-2020 The Software Heritage developers | ||||
# See the AUTHORS file at the top-level directory of this distribution | # See the AUTHORS file at the top-level directory of this distribution | ||||
# License: GNU General Public License version 3, or any later version | # License: GNU General Public License version 3, or any later version | ||||
# See top-level LICENSE file for more information | # See top-level LICENSE file for more information | ||||
import pytest | import pytest | ||||
from typing import Any, Dict | from typing import Any, Dict | ||||
@pytest.fixture | @pytest.fixture | ||||
def swh_loader_config() -> Dict[str, Any]: | def swh_loader_config() -> Dict[str, Any]: | ||||
return { | return { | ||||
"storage": {"cls": "pipeline", "steps": [{"cls": "memory",},],}, | "storage": {"cls": "pipeline", "steps": [{"cls": "memory",},],}, | ||||
"deposit": { | "deposit": { | ||||
"url": "https://deposit.softwareheritage.org/1/private", | "url": "https://deposit.softwareheritage.org/1/private", | ||||
"auth": {"username": "user", "password": "pass",}, | "auth": {"username": "user", "password": "pass",}, | ||||
}, | }, | ||||
} | } | ||||
ardumont: Pondering whether:
- it's in the right location
- to add tests on it (inclined to do so with… | |||||
Not Done Inline ActionsI'm not sure importing a function from conftest.py is the right move, but we seem to be doing that in a bunch of other places already, so shrug. I guess the thing that makes me most uncomfortable is the prospect of having other modules import stuff from this module's conftest.py. Don't we have another module in which we could put this function instead? olasd: I'm not sure importing a function from conftest.py is the right move, but we seem to be doing… | |||||
Done Inline ActionsWe have swh.core.pytest_plugin which declares pytest fixtures to reuse. ardumont: We have swh.core.pytest_plugin which declares pytest fixtures to reuse.
Not sure if that… | |||||
Done Inline Actions
done
I think i misread the question the first time. In loader-core, there is no such module. We have swh.loader.package.tests.common which technically is fine i guess. I guess it's the occasion to bootstrap a swh.loader.tests.common module and ardumont: > to add tests on it (inclined to do so with mocks)
done
>> Don't we have another module in… | |||||
Done Inline Actionsmoved that code to D3321 so that diff is less huge. ardumont: moved that code to D3321 so that diff is less huge. |
Pondering whether:
I intend to use it in other loader diffs [1] (which currently duplicates it)
[1] D3306 D3307 D3308