@@ -123,9 +123,9 @@ def test_tk_setPalette(self):
123
123
def test_after (self ):
124
124
root = self .root
125
125
126
- def callback (start = 0 , step = 1 ):
126
+ def callback (start = 0 , step = 1 , * , end = 0 ):
127
127
nonlocal count
128
- count = start + step
128
+ count = start + step + end
129
129
130
130
# Without function, sleeps for ms.
131
131
self .assertIsNone (root .after (1 ))
@@ -161,12 +161,18 @@ def callback(start=0, step=1):
161
161
root .update () # Process all pending events.
162
162
self .assertEqual (count , 53 )
163
163
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
+
164
170
def test_after_idle (self ):
165
171
root = self .root
166
172
167
- def callback (start = 0 , step = 1 ):
173
+ def callback (start = 0 , step = 1 , * , end = 0 ):
168
174
nonlocal count
169
- count = start + step
175
+ count = start + step + end
170
176
171
177
# Set up with callback with no args.
172
178
count = 0
@@ -193,6 +199,12 @@ def callback(start=0, step=1):
193
199
with self .assertRaises (tkinter .TclError ):
194
200
root .tk .call (script )
195
201
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
+
196
208
def test_after_cancel (self ):
197
209
root = self .root
198
210
0 commit comments