MCPcopy
hub / github.com/celery/celery / test_enter_after

Method test_enter_after

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

Source from the content-addressed store, hash-verified

8class test_Timer:
9
10 def test_enter_after(self):
11 t = timer2.Timer()
12 try:
13 done = [False]
14
15 def set_done():
16 done[0] = True
17
18 t.call_after(0.3, set_done)
19 mss = 0
20 while not done[0]:
21 if mss >= 2.0:
22 raise Exception('test timed out')
23 time.sleep(0.1)
24 mss += 0.1
25 finally:
26 t.stop()
27
28 def test_exit_after(self):
29 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