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

Method test_enterabs

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

Source from the content-addressed store, hash-verified

50 self.assertEqual(l, [0.1, 0.2, 0.3, 0.4, 0.5])
51
52 def test_enterabs(self):
53 l = []
54 fun = lambda x: l.append(x)
55 scheduler = sched.scheduler(time.time, time.sleep)
56 for x in [0.05, 0.04, 0.03, 0.02, 0.01]:
57 z = scheduler.enterabs(x, 1, fun, (x,))
58 scheduler.run()
59 self.assertEqual(l, [0.01, 0.02, 0.03, 0.04, 0.05])
60
61 @threading_helper.requires_working_threading()
62 def test_enter_concurrent(self):

Callers

nothing calls this directly

Calls 4

assertEqualMethod · 0.95
enterabsMethod · 0.80
appendMethod · 0.45
runMethod · 0.45

Tested by

no test coverage detected