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.redis.backend package

Submodules

pytest_celery.vendors.redis.backend.api module

The pytest-celery plugin provides a set of built-in components called Vendors.

This module is part of the Redis Backend vendor.

class pytest_celery.vendors.redis.backend.api.RedisTestBackend(container: CeleryTestContainer, app: Celery = None)[source]

Bases: CeleryTestBackend

teardown() None[source]

When a test that has a AsyncResult object is finished there’s a race condition between the AsyncResult object and the Redis container.

The AsyncResult object tries to release the connection but the Redis container has already exited.

pytest_celery.vendors.redis.backend.defaults module

The pytest-celery plugin provides a set of built-in components called Vendors.

This module is part of the Redis Backend vendor.

pytest_celery.vendors.redis.backend.fixtures module

The pytest-celery plugin provides a set of built-in components called Vendors.

This module is part of the Redis Backend vendor.

pytest_celery.vendors.redis.backend.fixtures.celery_redis_backend(default_redis_backend: RedisContainer) RedisTestBackend[source]

Creates a RedisTestBackend instance. Responsible for tearing down the node.

Parameters:

default_redis_backend (RedisContainer) – Instantiated RedisContainer.

pytest_celery.vendors.redis.backend.fixtures.default_redis_backend_cls() type[RedisContainer][source]

Default Redis backend container class. Override to apply custom configuration globally.

See also: Vendor Class.

Returns:

API for managing the vendor’s container.

Return type:

type[RedisContainer]

pytest_celery.vendors.redis.backend.fixtures.default_redis_backend_command(default_redis_backend_cls: type[RedisContainer]) list[str][source]

Command to run the container.

Parameters:

default_redis_backend_cls (type[RedisContainer]) – See also: Vendor Class.

Returns:

Docker CMD instruction.

Return type:

list[str]

pytest_celery.vendors.redis.backend.fixtures.default_redis_backend_env(default_redis_backend_cls: type[RedisContainer]) dict[source]

Environment variables for this vendor.

Parameters:

default_rabbitmq_broker_cls (type[RedisContainer]) – See also: Vendor Class.

Returns:

Items to pass to the container’s environment.

Return type:

dict

pytest_celery.vendors.redis.backend.fixtures.default_redis_backend_image(default_redis_backend_cls: type[RedisContainer]) str[source]

Sets the image name for this vendor.

Parameters:

default_rabbitmq_broker_cls (type[RedisContainer]) – See also: Vendor Class.

Returns:

Docker image name.

Return type:

str

pytest_celery.vendors.redis.backend.fixtures.default_redis_backend_ports(default_redis_backend_cls: type[RedisContainer]) dict[source]

Port bindings for this vendor.

Parameters:

default_redis_backend_cls (type[RedisContainer]) – See also: Vendor Class.

Returns:

Port bindings.

Return type:

dict

Module contents

The pytest-celery plugin provides a set of built-in components called Vendors.

This module is part of the Redis Backend vendor.