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

API Reference

Create Celery app instances used for testing. = {'accept_content': {'json'}, 'broker_heartbeat': 0, 'broker_url': 'memory://', 'enable_utc': True, 'result_backend': 'cache+memory://', 'timezone': 'UTC', 'worker_hijack_root_logger': False, 'worker_log_color': False}

Contains the default configuration values for the test app., config=None, enable_logging=False, set_as_current=False, log=<class ''>, backend=None, broker=None, **kwargs)[source]

App used for testing.


Trap that pretends to be an app but raises an exception instead.

This to protect from code that does not properly pass app instances, then falls back to the current_app.

class*args, **kwargs)[source]

Sets up logging for the test application.[source]

Contextmanager that installs the trap app.

The trap means that anything trying to use the current or default app will raise an exception., use_trap=False)[source]

Setup default app for testing.

Ensures state is clean after the test returns.