MCPcopy
hub / github.com/celery/celery / test_current_task

Method test_current_task

t/unit/app/test_app.py:468–477  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

466 _state._tls.current_app = current
467
468 def test_current_task(self):
469 @self.app.task
470 def foo(shared=False):
471 pass
472
473 _state._task_stack.push(foo)
474 try:
475 assert self.app.current_task.name == foo.name
476 finally:
477 _state._task_stack.pop()
478
479 def test_task_not_shared(self):
480 with patch('celery.app.base.connect_on_app_finalize') as sh:

Callers

nothing calls this directly

Calls 2

pushMethod · 0.80
popMethod · 0.45

Tested by

no test coverage detected