This document describes the current stable version of pytest_celery (1.0). For development docs, go here.

pytest_celery.vendors.memcached package

Submodules

pytest_celery.vendors.memcached.api module

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

This module is part of the Memcached Backend vendor.

class pytest_celery.vendors.memcached.api.MemcachedTestBackend(container: CeleryTestContainer, app: Celery = None)[source]

Bases: CeleryTestBackend

pytest_celery.vendors.memcached.container module

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

This module is part of the Memcached Backend vendor.

class pytest_celery.vendors.memcached.container.MemcachedContainer(container)[source]

Bases: CeleryTestContainer

This class manages the lifecycle of a Memcached 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:

dict

property client: Client

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

property host_url: str
property hostname: str
classmethod image() str[source]
classmethod initial_env() dict[source]
property port: int
classmethod ports() dict[source]
classmethod prefix() str[source]
property url: str
classmethod version() str[source]

pytest_celery.vendors.memcached.defaults module

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

This module is part of the Memcached Backend vendor.

pytest_celery.vendors.memcached.fixtures module

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

This module is part of the Memcached Backend vendor.

pytest_celery.vendors.memcached.fixtures.celery_memcached_backend(default_memcached_backend: MemcachedContainer) MemcachedTestBackend[source]

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

Parameters:

default_memcached_backend (MemcachedContainer) – Instantiated MemcachedContainer.

pytest_celery.vendors.memcached.fixtures.default_memcached_backend_cls() type[MemcachedContainer][source]

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

See also: Vendor Class.

Returns:

API for managing the vendor’s container.

Return type:

type[MemcachedContainer]

pytest_celery.vendors.memcached.fixtures.default_memcached_backend_env(default_memcached_backend_cls: type[MemcachedContainer]) dict[source]

Environment variables for this vendor.

Parameters:

default_memcached_backend_cls (type[MemcachedContainer]) – See also: Vendor Class.

Returns:

Items to pass to the container’s environment.

Return type:

dict

pytest_celery.vendors.memcached.fixtures.default_memcached_backend_image(default_memcached_backend_cls: type[MemcachedContainer]) str[source]

Docker image for this vendor.

Parameters:

default_memcached_backend_cls (type[MemcachedContainer]) – See also: Vendor Class.

Returns:

Docker image name.

Return type:

str

pytest_celery.vendors.memcached.fixtures.default_memcached_backend_ports(default_memcached_backend_cls: type[MemcachedContainer]) dict[source]

Port bindings for this vendor.

Parameters:

default_memcached_backend_cls (type[MemcachedContainer]) – 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 Memcached Backend vendor.