MCPcopy Index your code
hub / github.com/python/cpython / test_queue

Method test_queue

Lib/test/test_sched.py:182–194  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

180 self.assertTrue(scheduler.empty())
181
182 def test_queue(self):
183 l = []
184 fun = lambda x: l.append(x)
185 scheduler = sched.scheduler(time.time, time.sleep)
186 now = time.time()
187 e5 = scheduler.enterabs(now + 0.05, 1, fun)
188 e1 = scheduler.enterabs(now + 0.01, 1, fun)
189 e2 = scheduler.enterabs(now + 0.02, 1, fun)
190 e4 = scheduler.enterabs(now + 0.04, 1, fun)
191 e3 = scheduler.enterabs(now + 0.03, 1, fun)
192 # queue property is supposed to return an order list of
193 # upcoming events
194 self.assertEqual(scheduler.queue, [e1, e2, e3, e4, e5])
195
196 def test_args_kwargs(self):
197 seq = []

Callers

nothing calls this directly

Calls 4

assertEqualMethod · 0.95
enterabsMethod · 0.80
appendMethod · 0.45
timeMethod · 0.45

Tested by

no test coverage detected