diff options
author | Giampaolo Rodola' <g.rodola@gmail.com> | 2011-11-22 12:33:34 (GMT) |
---|---|---|
committer | Giampaolo Rodola' <g.rodola@gmail.com> | 2011-11-22 12:33:34 (GMT) |
commit | be55d99b3d0d289b2948fdcb6c8aa975687476d5 (patch) | |
tree | 64798196c6bb7ffb76a8630af119f07c239dd331 /Lib/test/test_sched.py | |
parent | ca4f20782e57ca4c754f477b19d36ac23e456b39 (diff) | |
download | cpython-be55d99b3d0d289b2948fdcb6c8aa975687476d5.zip cpython-be55d99b3d0d289b2948fdcb6c8aa975687476d5.tar.gz cpython-be55d99b3d0d289b2948fdcb6c8aa975687476d5.tar.bz2 |
Fix 13245:
sched.scheduler class constructor's timefunc and delayfunct parameters are now optional.
scheduler.enter and scheduler.enterabs methods gained a new kwargs parameter.
Patch contributed by Matt Mulsow.
Diffstat (limited to 'Lib/test/test_sched.py')
-rw-r--r-- | Lib/test/test_sched.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/Lib/test/test_sched.py b/Lib/test/test_sched.py index 29fd277..1af43cb 100644 --- a/Lib/test/test_sched.py +++ b/Lib/test/test_sched.py @@ -72,6 +72,18 @@ class TestCase(unittest.TestCase): scheduler.run() self.assertEqual(scheduler._queue, []) + def test_args_kwargs(self): + flag = [] + + def fun(*a, **b): + flag.append(None) + self.assertEqual(a, (1,2,3)) + self.assertEqual(b, {"foo":1}) + + scheduler = sched.scheduler(time.time, time.sleep) + z = scheduler.enterabs(0.01, 1, fun, argument=(1,2,3), kwargs={"foo":1}) + scheduler.run() + self.assertEqual(flag, [None]) def test_main(): support.run_unittest(TestCase) |