From e9c8f784fa13ea3a51df3b72a498a3896ec9e768 Mon Sep 17 00:00:00 2001 From: E-Paine <63801254+E-Paine@users.noreply.github.com> Date: Wed, 23 Jun 2021 11:30:24 +0100 Subject: bpo-44404: tkinter `after` support callable classes (GH-26812) --- Lib/tkinter/test/test_tkinter/test_misc.py | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'Lib/tkinter/test/test_tkinter/test_misc.py') diff --git a/Lib/tkinter/test/test_tkinter/test_misc.py b/Lib/tkinter/test/test_tkinter/test_misc.py index d4b7cbd867b..ab8f64790df 100644 --- a/Lib/tkinter/test/test_tkinter/test_misc.py +++ b/Lib/tkinter/test/test_tkinter/test_misc.py @@ -1,3 +1,4 @@ +import functools import unittest import tkinter import enum @@ -98,6 +99,12 @@ class MiscTest(AbstractTkTest, unittest.TestCase): with self.assertRaises(tkinter.TclError): root.tk.call(script) + # Call with a callable class + count = 0 + timer1 = root.after(0, functools.partial(callback, 42, 11)) + root.update() # Process all pending events. + self.assertEqual(count, 53) + def test_after_idle(self): root = self.root -- cgit v1.2.3