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

Method test_empty

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

Source from the content-addressed store, hash-verified

169 self.assertEqual(events, ["a", "c"])
170
171 def test_empty(self):
172 l = []
173 fun = lambda x: l.append(x)
174 scheduler = sched.scheduler(time.time, time.sleep)
175 self.assertTrue(scheduler.empty())
176 for x in [0.05, 0.04, 0.03, 0.02, 0.01]:
177 z = scheduler.enterabs(x, 1, fun, (x,))
178 self.assertFalse(scheduler.empty())
179 scheduler.run()
180 self.assertTrue(scheduler.empty())
181
182 def test_queue(self):
183 l = []

Callers

nothing calls this directly

Calls 6

assertTrueMethod · 0.95
assertFalseMethod · 0.95
enterabsMethod · 0.80
appendMethod · 0.45
emptyMethod · 0.45
runMethod · 0.45

Tested by

no test coverage detected