diff --git a/conftest.py b/conftest.py --- a/conftest.py +++ b/conftest.py @@ -1,3 +1,8 @@ +# Copyright (C) 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 + from hypothesis import settings # define tests profile. Full documentation is at: @@ -9,3 +14,6 @@ # configuration file is found (--doctest-modules forces the module # loading) collect_ignore = ["swh/indexer/storage/api/wsgi.py"] + +# we use the swh_scheduler fixture +pytest_plugins = ["swh.scheduler.pytest_plugin"] diff --git a/pytest.ini b/pytest.ini --- a/pytest.ini +++ b/pytest.ini @@ -1,2 +1,3 @@ [pytest] +addopts = -p no:pytest_swh_scheduler norecursedirs = docs diff --git a/requirements-test.txt b/requirements-test.txt --- a/requirements-test.txt +++ b/requirements-test.txt @@ -1,5 +1,5 @@ confluent-kafka pytest -pytest-postgresql hypothesis>=3.11.0 -swh.storage>= 0.0.178 +swh.scheduler[testing] >= 0.5.0 +swh.storage[testing] >= 0.10.0 diff --git a/swh/indexer/tests/conftest.py b/swh/indexer/tests/conftest.py --- a/swh/indexer/tests/conftest.py +++ b/swh/indexer/tests/conftest.py @@ -9,7 +9,6 @@ import pytest from swh.objstorage import get_objstorage -from swh.scheduler.tests.conftest import * # noqa from swh.storage import get_storage from swh.indexer.storage import get_indexer_storage @@ -76,11 +75,3 @@ "swh.objstorage.factory._STORAGE_CLASSES", {"memory": lambda: objstorage} ): yield objstorage - - -@pytest.fixture(scope="session") # type: ignore # expected redefinition -def celery_includes(): - return [ - "swh.indexer.tests.tasks", - "swh.indexer.tasks", - ] diff --git a/swh/indexer/tests/storage/conftest.py b/swh/indexer/tests/storage/conftest.py --- a/swh/indexer/tests/storage/conftest.py +++ b/swh/indexer/tests/storage/conftest.py @@ -7,7 +7,7 @@ import pytest from . import SQL_DIR -from swh.storage.tests.conftest import postgresql_fact +from swh.storage.pytest_plugin import postgresql_fact from swh.indexer.storage import get_indexer_storage from swh.model.hashutil import hash_to_bytes from .generate_data_test import MIMETYPE_OBJECTS, FOSSOLOGY_LICENSES, TOOLS diff --git a/tox.ini b/tox.ini --- a/tox.ini +++ b/tox.ini @@ -7,6 +7,8 @@ deps = pytest-cov pifpaf + swh-scheduler[testing] >= 0.5.0 + swh-storage[testing] >= 0.10.0 dev: pdbpp commands = pifpaf run postgresql -- pytest --doctest-modules \