Skip to main content

TestApp

App used for testing.

def TestApp(
name: string = None,
config: dict = None,
enable_logging: boolean = False,
set_as_current: boolean = False,
log: object = UnitLogging,
backend: string = None,
broker: string = None,
**kwargs: any
) - > Celery

App used for testing.

Parameters

NameTypeDescription
namestring = NoneThe name of the Celery application; defaults to 'celery.tests'.
configdict = NoneA dictionary of configuration settings to override the default test configuration.
enable_loggingboolean = FalseIf true, enables standard logging; otherwise, logging is suppressed or handled by the provided log object.
set_as_currentboolean = FalseIf true, sets this application instance as the current globally active Celery app.
logobject = UnitLoggingThe logging handler to use when enable_logging is false.
backendstring = NoneThe result backend URL to use for storing task results.
brokerstring = NoneThe message broker URL to use for task routing.
**kwargsanyAdditional keyword arguments passed directly to the Celery class constructor.

Returns

TypeDescription
CeleryA Celery application instance configured specifically for unit testing environments.