MCPcopy Create free account
hub / github.com/celery/celery / test_cancel__task_started

Method test_cancel__task_started

t/unit/worker/test_request.py:899–910  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

897 job.terminate(pool, signal='TERM')
898
899 def test_cancel__task_started(self):
900 pool = Mock()
901 signum = signal.SIGTERM
902 job = self.get_request(self.mytask.s(1, f='x'))
903 job._apply_result = Mock(name='_apply_result')
904 with self.assert_signal_called(
905 task_retry, sender=job.task, request=job._context,
906 einfo=None):
907 job.time_start = monotonic()
908 job.worker_pid = 314
909 job.cancel(pool, signal='TERM')
910 job._apply_result().terminate.assert_called_with(signum)
911
912 def test_cancel__task_reserved(self):
913 pool = Mock()

Callers

nothing calls this directly

Calls 3

get_requestMethod · 0.95
sMethod · 0.45
cancelMethod · 0.45

Tested by

no test coverage detected