summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/test_sched.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/Lib/test/test_sched.py b/Lib/test/test_sched.py
index 491d7b3..7ae7baa 100644
--- a/Lib/test/test_sched.py
+++ b/Lib/test/test_sched.py
@@ -142,6 +142,17 @@ class TestCase(unittest.TestCase):
self.assertTrue(q.empty())
self.assertEqual(timer.time(), 4)
+ def test_cancel_correct_event(self):
+ # bpo-19270
+ events = []
+ scheduler = sched.scheduler()
+ scheduler.enterabs(1, 1, events.append, ("a",))
+ b = scheduler.enterabs(1, 1, events.append, ("b",))
+ scheduler.enterabs(1, 1, events.append, ("c",))
+ scheduler.cancel(b)
+ scheduler.run()
+ self.assertEqual(events, ["a", "c"])
+
def test_empty(self):
l = []
fun = lambda x: l.append(x)