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

Method test_enter_after

t/unit/utils/test_timer2.py:31–47  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

29 assert t.schedule.max_interval == 7
30
31 def test_enter_after(self):
32 t = timer2.Timer()
33 try:
34 done = [False]
35
36 def set_done():
37 done[0] = True
38
39 t.call_after(0.3, set_done)
40 mss = 0
41 while not done[0]:
42 if mss >= 2.0:
43 raise Exception('test timed out')
44 time.sleep(0.1)
45 mss += 0.1
46 finally:
47 t.stop()
48
49 def test_exit_after(self):
50 t = timer2.Timer()

Callers

nothing calls this directly

Calls 3

call_afterMethod · 0.95
stopMethod · 0.95
sleepMethod · 0.45

Tested by

no test coverage detected