@@ -123,9 +123,9 @@ def test_tk_setPalette(self):
123123 def test_after (self ):
124124 root = self .root
125125
126- def callback (start = 0 , step = 1 ):
126+ def callback (start = 0 , step = 1 , * , end = 0 ):
127127 nonlocal count
128- count = start + step
128+ count = start + step + end
129129
130130 # Without function, sleeps for ms.
131131 self .assertIsNone (root .after (1 ))
@@ -161,12 +161,18 @@ def callback(start=0, step=1):
161161 root .update () # Process all pending events.
162162 self .assertEqual (count , 53 )
163163
164+ # Set up with callback with keyword args.
165+ count = 0
166+ timer1 = root .after (0 , callback , 42 , step = 11 , end = 1 )
167+ root .update () # Process all pending events.
168+ self .assertEqual (count , 54 )
169+
164170 def test_after_idle (self ):
165171 root = self .root
166172
167- def callback (start = 0 , step = 1 ):
173+ def callback (start = 0 , step = 1 , * , end = 0 ):
168174 nonlocal count
169- count = start + step
175+ count = start + step + end
170176
171177 # Set up with callback with no args.
172178 count = 0
@@ -193,6 +199,12 @@ def callback(start=0, step=1):
193199 with self .assertRaises (tkinter .TclError ):
194200 root .tk .call (script )
195201
202+ # Set up with callback with keyword args.
203+ count = 0
204+ idle1 = root .after_idle (callback , 42 , step = 11 , end = 1 )
205+ root .update () # Process all pending events.
206+ self .assertEqual (count , 54 )
207+
196208 def test_after_cancel (self ):
197209 root = self .root
198210
0 commit comments