diff --git a/src/pytest_celery/api/__init__.py b/src/pytest_celery/api/__init__.py index 27f4e36a8..7e3ef0ae7 100644 --- a/src/pytest_celery/api/__init__.py +++ b/src/pytest_celery/api/__init__.py @@ -1,12 +1,12 @@ # flake8: noqa -from pytest_celery.api.components import CeleryBackendCluster -from pytest_celery.api.components import CeleryBrokerCluster -from pytest_celery.api.components import CeleryTestBackend -from pytest_celery.api.components import CeleryTestBroker -from pytest_celery.api.components import CeleryTestCluster -from pytest_celery.api.components import CeleryTestNode -from pytest_celery.api.components import CeleryTestWorker -from pytest_celery.api.components import CeleryWorkerCluster +from pytest_celery.api.backend import CeleryBackendCluster +from pytest_celery.api.backend import CeleryTestBackend +from pytest_celery.api.base import CeleryTestCluster +from pytest_celery.api.base import CeleryTestNode +from pytest_celery.api.broker import CeleryBrokerCluster +from pytest_celery.api.broker import CeleryTestBroker from pytest_celery.api.container import CeleryTestContainer from pytest_celery.api.setup import CeleryTestSetup +from pytest_celery.api.worker import CeleryTestWorker +from pytest_celery.api.worker import CeleryWorkerCluster diff --git a/src/pytest_celery/api/components/backend/cluster.py b/src/pytest_celery/api/backend.py similarity index 69% rename from src/pytest_celery/api/components/backend/cluster.py rename to src/pytest_celery/api/backend.py index bb8fa86b5..9658ed1ed 100644 --- a/src/pytest_celery/api/components/backend/cluster.py +++ b/src/pytest_celery/api/backend.py @@ -3,12 +3,20 @@ from typing import Union from pytest_celery import defaults -from pytest_celery.api.components.backend.node import CeleryTestBackend -from pytest_celery.api.components.cluster.base import CeleryTestCluster -from pytest_celery.api.components.cluster.node import CeleryTestNode +from pytest_celery.api.base import CeleryTestCluster +from pytest_celery.api.base import CeleryTestNode from pytest_celery.api.container import CeleryTestContainer +class CeleryTestBackend(CeleryTestNode): + @classmethod + def default_config(cls) -> dict: + return { + "url": defaults.WORKER_ENV["CELERY_RESULT_BACKEND"], + "local_url": defaults.WORKER_ENV["CELERY_RESULT_BACKEND"], + } + + class CeleryBackendCluster(CeleryTestCluster): def __init__(self, *backends: Tuple[Union[CeleryTestBackend, CeleryTestContainer]]) -> None: super().__init__(*backends) diff --git a/src/pytest_celery/api/components/cluster/base.py b/src/pytest_celery/api/base.py similarity index 70% rename from src/pytest_celery/api/components/cluster/base.py rename to src/pytest_celery/api/base.py index 8b4c567b7..8475ae964 100644 --- a/src/pytest_celery/api/components/cluster/base.py +++ b/src/pytest_celery/api/base.py @@ -5,10 +5,45 @@ from typing import Type from typing import Union -from pytest_celery.api.components.cluster.node import CeleryTestNode from pytest_celery.api.container import CeleryTestContainer +class CeleryTestNode: + def __init__(self, container: CeleryTestContainer): + self._container = container + + @property + def container(self) -> CeleryTestContainer: + return self._container + + def ready(self) -> bool: + return self.container.ready() + + def config(self, *args: tuple, **kwargs: dict) -> dict: + return self.container.celeryconfig + + @classmethod + def default_config(cls) -> dict: + return {} + + def __eq__(self, __value: object) -> bool: + if isinstance(__value, CeleryTestNode): + return self.container == __value.container + return False + + def logs(self) -> str: + return self.container.logs() + + def name(self) -> str: + return self.container.name + + def kill(self) -> None: + self.container.kill() + + def teardown(self) -> None: + self.container.teardown() + + class CeleryTestCluster: def __init__(self, *nodes: Tuple[Union[CeleryTestNode, CeleryTestContainer]]) -> None: if not nodes: @@ -38,11 +73,11 @@ def __eq__(self, __value: object) -> bool: @property def nodes(self) -> Tuple[CeleryTestNode]: - return self._nodes + return self.s @nodes.setter def nodes(self, nodes: Tuple[Union[CeleryTestNode, CeleryTestContainer]]) -> None: - self._nodes = self._set_nodes(*nodes) # type: ignore + self.s = self._set_nodes(*nodes) # type: ignore @abstractmethod def _set_nodes( diff --git a/src/pytest_celery/api/components/broker/cluster.py b/src/pytest_celery/api/broker.py similarity index 69% rename from src/pytest_celery/api/components/broker/cluster.py rename to src/pytest_celery/api/broker.py index e47f8ff36..803dddadb 100644 --- a/src/pytest_celery/api/components/broker/cluster.py +++ b/src/pytest_celery/api/broker.py @@ -3,12 +3,20 @@ from typing import Union from pytest_celery import defaults -from pytest_celery.api.components.broker.node import CeleryTestBroker -from pytest_celery.api.components.cluster.base import CeleryTestCluster -from pytest_celery.api.components.cluster.node import CeleryTestNode +from pytest_celery.api.base import CeleryTestCluster +from pytest_celery.api.base import CeleryTestNode from pytest_celery.api.container import CeleryTestContainer +class CeleryTestBroker(CeleryTestNode): + @classmethod + def default_config(cls) -> dict: + return { + "url": defaults.WORKER_ENV["CELERY_BROKER_URL"], + "local_url": defaults.WORKER_ENV["CELERY_BROKER_URL"], + } + + class CeleryBrokerCluster(CeleryTestCluster): def __init__(self, *brokers: Tuple[Union[CeleryTestBroker, CeleryTestContainer]]) -> None: super().__init__(*brokers) diff --git a/src/pytest_celery/api/components/__init__.py b/src/pytest_celery/api/components/__init__.py deleted file mode 100644 index dd9652585..000000000 --- a/src/pytest_celery/api/components/__init__.py +++ /dev/null @@ -1,10 +0,0 @@ -# flake8: noqa - -from pytest_celery.api.components.backend import CeleryBackendCluster -from pytest_celery.api.components.backend import CeleryTestBackend -from pytest_celery.api.components.broker import CeleryBrokerCluster -from pytest_celery.api.components.broker import CeleryTestBroker -from pytest_celery.api.components.cluster import CeleryTestCluster -from pytest_celery.api.components.cluster import CeleryTestNode -from pytest_celery.api.components.worker.cluster import CeleryWorkerCluster -from pytest_celery.api.components.worker.node import CeleryTestWorker diff --git a/src/pytest_celery/api/components/backend/__init__.py b/src/pytest_celery/api/components/backend/__init__.py deleted file mode 100644 index f0606b881..000000000 --- a/src/pytest_celery/api/components/backend/__init__.py +++ /dev/null @@ -1,4 +0,0 @@ -# flake8: noqa - -from pytest_celery.api.components.backend.cluster import CeleryBackendCluster -from pytest_celery.api.components.backend.node import CeleryTestBackend diff --git a/src/pytest_celery/api/components/backend/node.py b/src/pytest_celery/api/components/backend/node.py deleted file mode 100644 index ff185cf6f..000000000 --- a/src/pytest_celery/api/components/backend/node.py +++ /dev/null @@ -1,11 +0,0 @@ -from pytest_celery import defaults -from pytest_celery.api.components.cluster.node import CeleryTestNode - - -class CeleryTestBackend(CeleryTestNode): - @classmethod - def default_config(cls) -> dict: - return { - "url": defaults.WORKER_ENV["CELERY_RESULT_BACKEND"], - "local_url": defaults.WORKER_ENV["CELERY_RESULT_BACKEND"], - } diff --git a/src/pytest_celery/api/components/broker/__init__.py b/src/pytest_celery/api/components/broker/__init__.py deleted file mode 100644 index d3c7999cb..000000000 --- a/src/pytest_celery/api/components/broker/__init__.py +++ /dev/null @@ -1,4 +0,0 @@ -# flake8: noqa - -from pytest_celery.api.components.broker.cluster import CeleryBrokerCluster -from pytest_celery.api.components.broker.node import CeleryTestBroker diff --git a/src/pytest_celery/api/components/broker/node.py b/src/pytest_celery/api/components/broker/node.py deleted file mode 100644 index dc616e1a4..000000000 --- a/src/pytest_celery/api/components/broker/node.py +++ /dev/null @@ -1,11 +0,0 @@ -from pytest_celery import defaults -from pytest_celery.api.components.cluster.node import CeleryTestNode - - -class CeleryTestBroker(CeleryTestNode): - @classmethod - def default_config(cls) -> dict: - return { - "url": defaults.WORKER_ENV["CELERY_BROKER_URL"], - "local_url": defaults.WORKER_ENV["CELERY_BROKER_URL"], - } diff --git a/src/pytest_celery/api/components/cluster/__init__.py b/src/pytest_celery/api/components/cluster/__init__.py deleted file mode 100644 index 98bcd9d69..000000000 --- a/src/pytest_celery/api/components/cluster/__init__.py +++ /dev/null @@ -1,4 +0,0 @@ -# flake8: noqa - -from pytest_celery.api.components.cluster.base import CeleryTestCluster -from pytest_celery.api.components.cluster.node import CeleryTestNode diff --git a/src/pytest_celery/api/components/cluster/node.py b/src/pytest_celery/api/components/cluster/node.py deleted file mode 100644 index 75dce27a7..000000000 --- a/src/pytest_celery/api/components/cluster/node.py +++ /dev/null @@ -1,37 +0,0 @@ -from pytest_celery.api.container import CeleryTestContainer - - -class CeleryTestNode: - def __init__(self, container: CeleryTestContainer): - self._container = container - - @property - def container(self) -> CeleryTestContainer: - return self._container - - def ready(self) -> bool: - return self.container.ready() - - def config(self, *args: tuple, **kwargs: dict) -> dict: - return self.container.celeryconfig - - @classmethod - def default_config(cls) -> dict: - return {} - - def __eq__(self, __value: object) -> bool: - if isinstance(__value, CeleryTestNode): - return self.container == __value.container - return False - - def logs(self) -> str: - return self.container.logs() - - def name(self) -> str: - return self.container.name - - def kill(self) -> None: - self.container.kill() - - def teardown(self) -> None: - self.container.teardown() diff --git a/src/pytest_celery/api/components/worker/__init__.py b/src/pytest_celery/api/components/worker/__init__.py deleted file mode 100644 index d8ca50bc6..000000000 --- a/src/pytest_celery/api/components/worker/__init__.py +++ /dev/null @@ -1,4 +0,0 @@ -# flake8: noqa - -from pytest_celery.api.components.worker.cluster import CeleryWorkerCluster -from pytest_celery.api.components.worker.node import CeleryTestWorker diff --git a/src/pytest_celery/api/components/worker/cluster.py b/src/pytest_celery/api/components/worker/cluster.py deleted file mode 100644 index d3d28e83a..000000000 --- a/src/pytest_celery/api/components/worker/cluster.py +++ /dev/null @@ -1,25 +0,0 @@ -from typing import Set -from typing import Tuple -from typing import Type -from typing import Union - -from pytest_celery.api.components.cluster.base import CeleryTestCluster -from pytest_celery.api.components.cluster.node import CeleryTestNode -from pytest_celery.api.components.worker.node import CeleryTestWorker -from pytest_celery.api.container import CeleryTestContainer - - -class CeleryWorkerCluster(CeleryTestCluster): - def __init__(self, *workers: Tuple[Union[CeleryTestWorker, CeleryTestContainer]]) -> None: - super().__init__(*workers) - - def _set_nodes( - self, - *nodes: Tuple[Union[CeleryTestNode, CeleryTestContainer]], - node_cls: Type[CeleryTestNode] = CeleryTestWorker, - ) -> Tuple[CeleryTestNode]: - return super()._set_nodes(*nodes, node_cls=node_cls) - - @property - def versions(self) -> Set[str]: - return {worker.version for worker in self} # type: ignore diff --git a/src/pytest_celery/api/setup.py b/src/pytest_celery/api/setup.py index 347ca42f6..0e31b7511 100644 --- a/src/pytest_celery/api/setup.py +++ b/src/pytest_celery/api/setup.py @@ -1,10 +1,10 @@ from celery import Celery from pytest_celery import defaults -from pytest_celery.api.components.backend.cluster import CeleryBackendCluster -from pytest_celery.api.components.broker.cluster import CeleryBrokerCluster -from pytest_celery.api.components.worker.cluster import CeleryWorkerCluster -from pytest_celery.api.components.worker.node import CeleryTestWorker +from pytest_celery.api.backend import CeleryBackendCluster +from pytest_celery.api.broker import CeleryBrokerCluster +from pytest_celery.api.worker import CeleryTestWorker +from pytest_celery.api.worker import CeleryWorkerCluster class CeleryTestSetup: diff --git a/src/pytest_celery/api/components/worker/node.py b/src/pytest_celery/api/worker.py similarity index 54% rename from src/pytest_celery/api/components/worker/node.py rename to src/pytest_celery/api/worker.py index a2a62ffd3..59fb02970 100644 --- a/src/pytest_celery/api/components/worker/node.py +++ b/src/pytest_celery/api/worker.py @@ -1,6 +1,12 @@ +from typing import Set +from typing import Tuple +from typing import Type +from typing import Union + from celery import Celery -from pytest_celery.api.components.cluster.node import CeleryTestNode +from pytest_celery.api.base import CeleryTestCluster +from pytest_celery.api.base import CeleryTestNode from pytest_celery.api.container import CeleryTestContainer from pytest_celery.containers.worker import CeleryWorkerContainer @@ -33,3 +39,19 @@ def worker_name(self) -> str: @property def worker_queue(self) -> str: return self.container.worker_queue() + + +class CeleryWorkerCluster(CeleryTestCluster): + def __init__(self, *workers: Tuple[Union[CeleryTestWorker, CeleryTestContainer]]) -> None: + super().__init__(*workers) + + def _set_nodes( + self, + *nodes: Tuple[Union[CeleryTestNode, CeleryTestContainer]], + node_cls: Type[CeleryTestNode] = CeleryTestWorker, + ) -> Tuple[CeleryTestNode]: + return super()._set_nodes(*nodes, node_cls=node_cls) + + @property + def versions(self) -> Set[str]: + return {worker.version for worker in self} # type: ignore diff --git a/src/pytest_celery/components/worker/fixtures.py b/src/pytest_celery/components/worker/fixtures.py index c3101d894..264cb741a 100644 --- a/src/pytest_celery/components/worker/fixtures.py +++ b/src/pytest_celery/components/worker/fixtures.py @@ -10,7 +10,7 @@ from pytest_docker_tools import volume from pytest_celery import defaults -from pytest_celery.api.components.worker.node import CeleryTestWorker +from pytest_celery.api.worker import CeleryTestWorker from pytest_celery.containers.worker import CeleryWorkerContainer diff --git a/src/pytest_celery/defaults.py b/src/pytest_celery/defaults.py index 60a384d7e..ff3017f8d 100644 --- a/src/pytest_celery/defaults.py +++ b/src/pytest_celery/defaults.py @@ -92,7 +92,7 @@ # Default container settings for all worker container fixtures WORKER_CELERY_APP_NAME = "celery_test_app" -WORKER_CELERY_VERSION = "5.3.0b2" +WORKER_CELERY_VERSION = "5.3" WORKER_LOG_LEVEL = "INFO" WORKER_NAME = CELERY_SETUP_WORKER WORKER_QUEUE = "celery" diff --git a/src/pytest_celery/fixtures/backend.py b/src/pytest_celery/fixtures/backend.py index 0cc44dceb..0c87fa5ee 100644 --- a/src/pytest_celery/fixtures/backend.py +++ b/src/pytest_celery/fixtures/backend.py @@ -3,8 +3,8 @@ import pytest from pytest_celery import defaults -from pytest_celery.api.components.backend import CeleryBackendCluster -from pytest_celery.api.components.backend import CeleryTestBackend +from pytest_celery.api.backend import CeleryBackendCluster +from pytest_celery.api.backend import CeleryTestBackend @pytest.fixture(params=defaults.ALL_CELERY_BACKENDS) diff --git a/src/pytest_celery/fixtures/broker.py b/src/pytest_celery/fixtures/broker.py index 4d6ac8e49..1ec13ef68 100644 --- a/src/pytest_celery/fixtures/broker.py +++ b/src/pytest_celery/fixtures/broker.py @@ -3,8 +3,8 @@ import pytest from pytest_celery import defaults -from pytest_celery.api.components.broker import CeleryBrokerCluster -from pytest_celery.api.components.broker import CeleryTestBroker +from pytest_celery.api.broker import CeleryBrokerCluster +from pytest_celery.api.broker import CeleryTestBroker @pytest.fixture(params=defaults.ALL_CELERY_BROKERS) diff --git a/src/pytest_celery/fixtures/setup.py b/src/pytest_celery/fixtures/setup.py index e2d88883c..b7cb18eb2 100644 --- a/src/pytest_celery/fixtures/setup.py +++ b/src/pytest_celery/fixtures/setup.py @@ -3,10 +3,10 @@ import pytest from celery import Celery -from pytest_celery.api.components.backend.cluster import CeleryBackendCluster -from pytest_celery.api.components.broker.cluster import CeleryBrokerCluster -from pytest_celery.api.components.worker.cluster import CeleryWorkerCluster +from pytest_celery.api.backend import CeleryBackendCluster +from pytest_celery.api.broker import CeleryBrokerCluster from pytest_celery.api.setup import CeleryTestSetup +from pytest_celery.api.worker import CeleryWorkerCluster @pytest.fixture diff --git a/src/pytest_celery/fixtures/worker.py b/src/pytest_celery/fixtures/worker.py index 7c6ed7530..9d1d0cc1a 100644 --- a/src/pytest_celery/fixtures/worker.py +++ b/src/pytest_celery/fixtures/worker.py @@ -3,8 +3,8 @@ import pytest from pytest_celery import defaults -from pytest_celery.api.components.worker import CeleryTestWorker -from pytest_celery.api.components.worker import CeleryWorkerCluster +from pytest_celery.api.worker import CeleryTestWorker +from pytest_celery.api.worker import CeleryWorkerCluster @pytest.fixture(params=defaults.ALL_CELERY_WORKERS) diff --git a/tests/conftest.py b/tests/conftest.py index 1000b3247..890d3aa89 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -7,7 +7,7 @@ from pytest_docker_tools import fxtr from pytest_celery import defaults -from pytest_celery.api.components.worker.node import CeleryTestWorker +from pytest_celery.api.worker import CeleryTestWorker from pytest_celery.containers.worker import CeleryWorkerContainer diff --git a/tests/integration/components/test_worker.py b/tests/integration/components/test_worker.py index cd04c0785..5cbffc7a6 100644 --- a/tests/integration/components/test_worker.py +++ b/tests/integration/components/test_worker.py @@ -3,7 +3,7 @@ from pytest_lazyfixture import lazy_fixture from pytest_celery import defaults -from pytest_celery.api.components.worker.node import CeleryTestWorker +from pytest_celery.api.worker import CeleryTestWorker @pytest.mark.parametrize("node", [lazy_fixture(defaults.CELERY_SETUP_WORKER)]) diff --git a/tests/integration/setup/custom/conftest.py b/tests/integration/setup/custom/conftest.py index 1ce84f128..fff24fca5 100644 --- a/tests/integration/setup/custom/conftest.py +++ b/tests/integration/setup/custom/conftest.py @@ -5,8 +5,8 @@ from pytest_docker_tools import fxtr from pytest_celery import defaults -from pytest_celery.api.components.worker.cluster import CeleryWorkerCluster -from pytest_celery.api.components.worker.node import CeleryTestWorker +from pytest_celery.api.worker import CeleryTestWorker +from pytest_celery.api.worker import CeleryWorkerCluster from pytest_celery.containers.worker import CeleryWorkerContainer from tests.conftest import Celery5WorkerContainer diff --git a/tests/integration/setup/custom/test_custom_setup.py b/tests/integration/setup/custom/test_custom_setup.py index 42fdfb2c7..88ac8c545 100644 --- a/tests/integration/setup/custom/test_custom_setup.py +++ b/tests/integration/setup/custom/test_custom_setup.py @@ -2,8 +2,8 @@ from pytest_docker_tools.wrappers.container import wait_for_callable from pytest_celery import defaults -from pytest_celery.api.components.worker.node import CeleryTestWorker from pytest_celery.api.setup import CeleryTestSetup +from pytest_celery.api.worker import CeleryTestWorker from tests.conftest import Celery4WorkerContainer from tests.conftest import Celery5WorkerContainer from tests.tasks import identity diff --git a/tests/integration/setup/test_setup.py b/tests/integration/setup/test_setup.py index 7d36b77b0..fbde7ba6e 100644 --- a/tests/integration/setup/test_setup.py +++ b/tests/integration/setup/test_setup.py @@ -3,8 +3,8 @@ from pytest_docker_tools.wrappers.container import wait_for_callable from pytest_celery import defaults -from pytest_celery.api.components.worker.node import CeleryTestWorker from pytest_celery.api.setup import CeleryTestSetup +from pytest_celery.api.worker import CeleryTestWorker from tests.tasks import identity diff --git a/tests/smoke/acceptance/conftest.py b/tests/smoke/acceptance/conftest.py index 1e0ba94c9..5e6b1232c 100644 --- a/tests/smoke/acceptance/conftest.py +++ b/tests/smoke/acceptance/conftest.py @@ -2,8 +2,8 @@ import pytest -from pytest_celery.api.components.worker.cluster import CeleryWorkerCluster -from pytest_celery.api.components.worker.node import CeleryTestWorker +from pytest_celery.api.worker import CeleryTestWorker +from pytest_celery.api.worker import CeleryWorkerCluster @pytest.fixture( diff --git a/tests/smoke/acceptance/test_canvas.py b/tests/smoke/acceptance/test_canvas.py index 70c23f8e7..961f5f556 100644 --- a/tests/smoke/acceptance/test_canvas.py +++ b/tests/smoke/acceptance/test_canvas.py @@ -7,7 +7,7 @@ from pytest_celery import CeleryTestSetup from pytest_celery import defaults -from pytest_celery.api.components.worker.node import CeleryTestWorker +from pytest_celery.api.worker import CeleryTestWorker from tests.smoke.tasks import add from tests.tasks import identity diff --git a/tests/smoke/test_failover.py b/tests/smoke/test_failover.py index e9725a338..e7210b58c 100644 --- a/tests/smoke/test_failover.py +++ b/tests/smoke/test_failover.py @@ -6,7 +6,7 @@ from pytest_celery import CeleryTestSetup from pytest_celery import defaults -from pytest_celery.api.components.broker.cluster import CeleryBrokerCluster +from pytest_celery.api.broker import CeleryBrokerCluster from pytest_celery.components.broker.rabbitmq.api import RabbitMQTestBroker from pytest_celery.containers.rabbitmq import RabbitMQContainer from tests.tasks import identity diff --git a/tests/smoke/test_signals.py b/tests/smoke/test_signals.py index d5967b389..999ecf37a 100644 --- a/tests/smoke/test_signals.py +++ b/tests/smoke/test_signals.py @@ -5,7 +5,7 @@ from pytest_celery import CeleryTestSetup from pytest_celery import defaults -from pytest_celery.api.components.worker.node import CeleryTestWorker +from pytest_celery.api.worker import CeleryTestWorker from tests.tasks import identity diff --git a/tests/unit/components/test_worker.py b/tests/unit/components/test_worker.py index 2caaf2927..7a65bad60 100644 --- a/tests/unit/components/test_worker.py +++ b/tests/unit/components/test_worker.py @@ -1,6 +1,6 @@ from celery import Celery -from pytest_celery.api.components.worker.node import CeleryTestWorker +from pytest_celery.api.worker import CeleryTestWorker class test_base_test_worker: diff --git a/tests/unit/conftest.py b/tests/unit/conftest.py index 4ba564601..37b87e581 100644 --- a/tests/unit/conftest.py +++ b/tests/unit/conftest.py @@ -11,7 +11,7 @@ from pytest_docker_tools import volume from pytest_celery import defaults -from pytest_celery.api.components.worker.node import CeleryTestWorker +from pytest_celery.api.worker import CeleryTestWorker from pytest_celery.components.backend.redis.api import RedisTestBackend from pytest_celery.components.broker.rabbitmq.api import RabbitMQTestBroker from pytest_celery.components.broker.redis.api import RedisTestBroker diff --git a/tests/unit/setup/test_setup.py b/tests/unit/setup/test_setup.py index 384096c38..89d03c31f 100644 --- a/tests/unit/setup/test_setup.py +++ b/tests/unit/setup/test_setup.py @@ -1,9 +1,9 @@ from celery import Celery -from pytest_celery.api.components.backend.node import CeleryTestBackend -from pytest_celery.api.components.broker.node import CeleryTestBroker -from pytest_celery.api.components.worker.node import CeleryTestWorker +from pytest_celery.api.backend import CeleryTestBackend +from pytest_celery.api.broker import CeleryTestBroker from pytest_celery.api.setup import CeleryTestSetup +from pytest_celery.api.worker import CeleryTestWorker class test_celery_test_setup_unit: