diff --git a/MANIFEST.in b/MANIFEST.in index c31438fc6399acf3302782e6cba5271301de7b7b..2f90a77b3df9688e759f43464e9b5363b1d92fa0 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -2,6 +2,7 @@ include Makefile include README include requirements*.txt include version.txt +include conftest.py include swh/lister/cran/list_all_packages.R recursive-include swh/lister/*/tests/data/ * recursive-include swh py.typed diff --git a/conftest.py b/conftest.py index 1759d04da6daee24503a25683f5582a7f97f0149..e709cbe56aba7954bbbb746006efab26c7173ddf 100644 --- a/conftest.py +++ b/conftest.py @@ -7,7 +7,7 @@ import os import pytest -pytest_plugins = ["swh.scheduler.pytest_plugin"] +pytest_plugins = ["swh.scheduler.pytest_plugin", "swh.lister.pytest_plugin"] os.environ["LC_ALL"] = "C.UTF-8" diff --git a/swh/lister/bitbucket/tests/conftest.py b/swh/lister/bitbucket/tests/conftest.py deleted file mode 100644 index 507fef9155c09d3c24b5bbd30826801e6ee4ff6c..0000000000000000000000000000000000000000 --- a/swh/lister/bitbucket/tests/conftest.py +++ /dev/null @@ -1 +0,0 @@ -from swh.lister.core.tests.conftest import * # noqa diff --git a/swh/lister/cgit/tests/conftest.py b/swh/lister/cgit/tests/conftest.py deleted file mode 100644 index 507fef9155c09d3c24b5bbd30826801e6ee4ff6c..0000000000000000000000000000000000000000 --- a/swh/lister/cgit/tests/conftest.py +++ /dev/null @@ -1 +0,0 @@ -from swh.lister.core.tests.conftest import * # noqa diff --git a/swh/lister/cran/tests/conftest.py b/swh/lister/cran/tests/conftest.py index 30d88c385990f4a61c9248b706885b865d5d9cb8..7b7777a249c0348042ffa16ea88b2cd74e16711f 100644 --- a/swh/lister/cran/tests/conftest.py +++ b/swh/lister/cran/tests/conftest.py @@ -5,8 +5,6 @@ import pytest -from swh.lister.core.tests.conftest import * # noqa - @pytest.fixture def lister_cran(swh_listers): diff --git a/swh/lister/debian/tests/conftest.py b/swh/lister/debian/tests/conftest.py index 4b2ab4c383ba769478c200dbd968bf5a0e824e66..bea3f46c3c5988f4aadc42b14704f6ceb96cecad 100644 --- a/swh/lister/debian/tests/conftest.py +++ b/swh/lister/debian/tests/conftest.py @@ -1,4 +1,4 @@ -# 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 # License: GNU General Public License version 3, or any later version # See top-level LICENSE file for more information @@ -9,7 +9,6 @@ from pytest_postgresql.janitor import DatabaseJanitor from sqlalchemy import create_engine from sqlalchemy.orm import sessionmaker -from swh.lister.core.tests.conftest import * # noqa from swh.lister.core.models import SQLBase from swh.lister.debian import debian_init diff --git a/swh/lister/gitea/tests/conftest.py b/swh/lister/gitea/tests/conftest.py deleted file mode 100644 index c18796b03b0597fdb5f05f395824c123cff887bd..0000000000000000000000000000000000000000 --- a/swh/lister/gitea/tests/conftest.py +++ /dev/null @@ -1,6 +0,0 @@ -# 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 swh.lister.core.tests.conftest import * # noqa diff --git a/swh/lister/github/tests/conftest.py b/swh/lister/github/tests/conftest.py deleted file mode 100644 index 507fef9155c09d3c24b5bbd30826801e6ee4ff6c..0000000000000000000000000000000000000000 --- a/swh/lister/github/tests/conftest.py +++ /dev/null @@ -1 +0,0 @@ -from swh.lister.core.tests.conftest import * # noqa diff --git a/swh/lister/gitlab/tests/conftest.py b/swh/lister/gitlab/tests/conftest.py deleted file mode 100644 index 24269871f1b0c1d375b22c85832eb362648f0ef2..0000000000000000000000000000000000000000 --- a/swh/lister/gitlab/tests/conftest.py +++ /dev/null @@ -1,6 +0,0 @@ -# Copyright (C) 2019 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 swh.lister.core.tests.conftest import * # noqa diff --git a/swh/lister/gnu/tests/conftest.py b/swh/lister/gnu/tests/conftest.py deleted file mode 100644 index a4b2b262f26dc08b5da46f33d7e3f17a145a7073..0000000000000000000000000000000000000000 --- a/swh/lister/gnu/tests/conftest.py +++ /dev/null @@ -1,6 +0,0 @@ -# Copyright (C) 2019 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 swh.lister.core.tests.conftest import * # noqa diff --git a/swh/lister/launchpad/tests/conftest.py b/swh/lister/launchpad/tests/conftest.py index d1dd73ed3798ff04a5fd87e51432f2daccdf4a92..655d8589c111c5b83ee39b6341f0bc04300f9d45 100644 --- a/swh/lister/launchpad/tests/conftest.py +++ b/swh/lister/launchpad/tests/conftest.py @@ -3,7 +3,6 @@ # License: GNU General Public License version 3, or any later version # See top-level LICENSE file for more information -from swh.lister.core.tests.conftest import * # noqa from datetime import datetime import json import os diff --git a/swh/lister/npm/tests/conftest.py b/swh/lister/npm/tests/conftest.py index bfa555f438276a0956a57f7047dfc32e694c7edc..507064d67c60f08df1af7a57393233c97efe2657 100644 --- a/swh/lister/npm/tests/conftest.py +++ b/swh/lister/npm/tests/conftest.py @@ -1,12 +1,10 @@ -# 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 # License: GNU General Public License version 3, or any later version # See top-level LICENSE file for more information import pytest -from swh.lister.core.tests.conftest import * # noqa - @pytest.fixture def lister_npm(swh_listers): diff --git a/swh/lister/packagist/tests/conftest.py b/swh/lister/packagist/tests/conftest.py index 1eafc36a59669eb1b8db1f62c354a988ea5d088c..81f8e4499b2234014e6604ff277224bac5b158cb 100644 --- a/swh/lister/packagist/tests/conftest.py +++ b/swh/lister/packagist/tests/conftest.py @@ -1,12 +1,10 @@ -# 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 # License: GNU General Public License version 3, or any later version # See top-level LICENSE file for more information import pytest -from swh.lister.core.tests.conftest import * # noqa - @pytest.fixture def lister_packagist(swh_listers): diff --git a/swh/lister/phabricator/tests/conftest.py b/swh/lister/phabricator/tests/conftest.py index 2713ce9c261caf8fe7b2990c845ca575526c5367..192612207a464b462f8036d599595f4b5892b554 100644 --- a/swh/lister/phabricator/tests/conftest.py +++ b/swh/lister/phabricator/tests/conftest.py @@ -1,12 +1,10 @@ -# 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 # License: GNU General Public License version 3, or any later version # See top-level LICENSE file for more information import pytest -from swh.lister.core.tests.conftest import * # noqa - @pytest.fixture def lister_phabricator(swh_listers): diff --git a/swh/lister/pypi/tests/conftest.py b/swh/lister/pypi/tests/conftest.py index 658fdcb75dca1142461ad18ed80ebbf20c1cca90..5d235f7a3f742e6f40e0a089b3f89465fd285ee6 100644 --- a/swh/lister/pypi/tests/conftest.py +++ b/swh/lister/pypi/tests/conftest.py @@ -1,12 +1,10 @@ -# 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 # License: GNU General Public License version 3, or any later version # See top-level LICENSE file for more information import pytest -from swh.lister.core.tests.conftest import * # noqa - @pytest.fixture def lister_pypi(swh_listers): diff --git a/swh/lister/core/tests/conftest.py b/swh/lister/pytest_plugin.py similarity index 99% rename from swh/lister/core/tests/conftest.py rename to swh/lister/pytest_plugin.py index 647fd466c77e046f8a269ab1bcc0410c8654a7df..d58195c907bba1ff18fda51dc7cc13f0c151216c 100644 --- a/swh/lister/core/tests/conftest.py +++ b/swh/lister/pytest_plugin.py @@ -4,6 +4,7 @@ # See top-level LICENSE file for more information import logging + import pytest from sqlalchemy import create_engine @@ -11,6 +12,7 @@ from sqlalchemy import create_engine from swh.lister import get_lister, SUPPORTED_LISTERS from swh.lister.core.models import initialize + logger = logging.getLogger(__name__)