MCPcopy
hub / github.com/celery/celery / test_eager

Method test_eager

t/unit/tasks/test_chord.py:264–279  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

262class test_chord(ChordCase):
263
264 def test_eager(self):
265 from celery import chord
266
267 @self.app.task(shared=False)
268 def addX(x, y):
269 return x + y
270
271 @self.app.task(shared=False)
272 def sumX(n):
273 return sum(n)
274
275 self.app.conf.task_always_eager = True
276 x = chord(addX.s(i, i) for i in range(10))
277 body = sumX.s()
278 result = x(body)
279 assert result.get() == sum(i + i for i in range(10))
280
281 def test_apply(self):
282 self.app.conf.task_always_eager = False

Callers

nothing calls this directly

Calls 4

chordFunction · 0.90
xFunction · 0.85
sMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected