Changeset View
Changeset View
Standalone View
Standalone View
swh/loader/package/tests/conftest.py
# Copyright (C) 2019 The Software Heritage developers | # Copyright (C) 2019 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 os | import os | ||||
import pytest | import pytest | ||||
import yaml | import yaml | ||||
from swh.storage.tests.conftest import * # noqa | from swh.storage.tests.conftest import * # noqa | ||||
from swh.scheduler.tests.conftest import * # noqa | |||||
@pytest.fixture | @pytest.fixture | ||||
def swh_config(monkeypatch, swh_storage_postgresql, tmp_path): | def swh_config(monkeypatch, swh_storage_postgresql, tmp_path): | ||||
storage_config = { | storage_config = { | ||||
'storage': { | 'storage': { | ||||
'cls': 'local', | 'cls': 'local', | ||||
'args': { | 'args': { | ||||
Show All 17 Lines | |||||
@pytest.fixture(autouse=True, scope='session') | @pytest.fixture(autouse=True, scope='session') | ||||
def swh_proxy(): | def swh_proxy(): | ||||
"""Automatically inject this fixture in all tests to ensure no outside | """Automatically inject this fixture in all tests to ensure no outside | ||||
connection takes place. | connection takes place. | ||||
""" | """ | ||||
os.environ['http_proxy'] = 'http://localhost:999' | os.environ['http_proxy'] = 'http://localhost:999' | ||||
os.environ['https_proxy'] = 'http://localhost:999' | os.environ['https_proxy'] = 'http://localhost:999' | ||||
@pytest.fixture(scope='session') # type: ignore # expected redefinition | |||||
def celery_includes(): | |||||
return [ | |||||
'swh.loader.package.tasks', | |||||
] |