summaryrefslogtreecommitdiffstats
path: root/Lib/tkinter/test
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2021-06-27 08:02:02 (GMT)
committerGitHub <noreply@github.com>2021-06-27 08:02:02 (GMT)
commite1f3bd2bb50a76ba15a2f8d561e2c9968ae3a1b2 (patch)
tree85bdbab452409679eb5dec48bb0c668447909279 /Lib/tkinter/test
parent3df23b5199a4bb237a595cadca6c49d34ab2a56c (diff)
downloadcpython-e1f3bd2bb50a76ba15a2f8d561e2c9968ae3a1b2.zip
cpython-e1f3bd2bb50a76ba15a2f8d561e2c9968ae3a1b2.tar.gz
cpython-e1f3bd2bb50a76ba15a2f8d561e2c9968ae3a1b2.tar.bz2
bpo-44404: tkinter `after` support callable classes (GH-26812)
(cherry picked from commit e9c8f784fa13ea3a51df3b72a498a3896ec9e768) Co-authored-by: E-Paine <63801254+E-Paine@users.noreply.github.com>
Diffstat (limited to 'Lib/tkinter/test')
-rw-r--r--Lib/tkinter/test/test_tkinter/test_misc.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/Lib/tkinter/test/test_tkinter/test_misc.py b/Lib/tkinter/test/test_tkinter/test_misc.py
index d4b7cbd..ab8f647 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