This document is for pytest_celery's development version, which can be significantly different from previous releases. Get the stable docs here: 1.1.
pytest_celery.vendors.rabbitmq package¶
Submodules¶
pytest_celery.vendors.rabbitmq.api module¶
The pytest-celery plugin provides a set of built-in components called Vendors.
This module is part of the RabbitMQ Broker vendor.
- class pytest_celery.vendors.rabbitmq.api.RabbitMQTestBroker(container: CeleryTestContainer, app: Celery = None)[source]¶
Bases:
CeleryTestBroker
pytest_celery.vendors.rabbitmq.container module¶
The pytest-celery plugin provides a set of built-in components called Vendors.
This module is part of the RabbitMQ Broker vendor.
- class pytest_celery.vendors.rabbitmq.container.RabbitMQContainer(container)[source]¶
Bases:
CeleryTestContainer
This class manages the lifecycle of a RabbitMQ container.
- property celeryconfig: dict¶
Each container is responsible for providing the configuration values required for Celery. This property should be implemented to return the configuration values for the specific container.
- Raises:
NotImplementedError – There is no config available by default.
- Returns:
Configuration values required for Celery.
- Return type:
- property client: Connection¶
Provides an API client for interacting with the container, if available.
Subclasses should implement this to return an instance of the client specific to the service running in the container.
- Raises:
NotImplementedError – There is not client available by default.
- Returns:
Client instance.
- Return type:
Any
pytest_celery.vendors.rabbitmq.defaults module¶
The pytest-celery plugin provides a set of built-in components called Vendors.
This module is part of the RabbitMQ Broker vendor.
pytest_celery.vendors.rabbitmq.fixtures module¶
The pytest-celery plugin provides a set of built-in components called Vendors.
This module is part of the RabbitMQ Broker vendor.
- pytest_celery.vendors.rabbitmq.fixtures.celery_rabbitmq_broker(default_rabbitmq_broker: RabbitMQContainer) RabbitMQTestBroker [source]¶
Creates a RabbitMQTestBroker instance. Responsible for tearing down the node.
- Parameters:
default_rabbitmq_broker (RabbitMQContainer) – Instantiated RabbitMQContainer.
- pytest_celery.vendors.rabbitmq.fixtures.default_rabbitmq_broker_cls() type[RabbitMQContainer] [source]¶
Default RabbitMQ broker container class. Override to apply custom configuration globally.
See also: Vendor Class.
- Returns:
API for managing the vendor’s container.
- Return type:
- pytest_celery.vendors.rabbitmq.fixtures.default_rabbitmq_broker_env(default_rabbitmq_broker_cls: type[RabbitMQContainer]) dict [source]¶
Environment variables for this vendor.
- Parameters:
default_rabbitmq_broker_cls (type[RabbitMQContainer]) – See also: Vendor Class.
- Returns:
Items to pass to the container’s environment.
- Return type:
- pytest_celery.vendors.rabbitmq.fixtures.default_rabbitmq_broker_image(default_rabbitmq_broker_cls: type[RabbitMQContainer]) str [source]¶
Sets the image name for this vendor.
- Parameters:
default_rabbitmq_broker_cls (type[RabbitMQContainer]) – See also: Vendor Class.
- Returns:
Docker image name.
- Return type:
- pytest_celery.vendors.rabbitmq.fixtures.default_rabbitmq_broker_ports(default_rabbitmq_broker_cls: type[RabbitMQContainer]) dict [source]¶
Port bindings for this vendor.
- Parameters:
default_rabbitmq_broker_cls (type[RabbitMQContainer]) – See also: Vendor Class.
- Returns:
Port bindings.
- Return type:
Module contents¶
The pytest-celery plugin provides a set of built-in components called Vendors.
This module is part of the RabbitMQ Broker vendor.