Skip to content

Commit 4000c4b

Browse files
committed
Rename check_widgets -> check_widget_children to be more clear
I stared at this for a while before I realized we had check_widget and check_widgets. This rename makes the distinction between these functions more clear.
1 parent 78734fc commit 4000c4b

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

python/ipywidgets/ipywidgets/widgets/tests/test_interaction.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ def check_widget(w, **d):
5252
te = type(expected)
5353
assert tv is te, "type({}.{}) = {!r} != {!r}".format(w.__class__.__name__, attr, tv, te)
5454

55-
def check_widgets(container, **to_check):
55+
def check_widget_children(container, **to_check):
5656
"""Check that widgets are created as expected"""
5757
# build a widget dictionary, so it matches
5858
widgets = {}
@@ -144,7 +144,7 @@ def test_list_str():
144144
_options_labels=tuple(values),
145145
_options_values=tuple(values),
146146
)
147-
check_widgets(c, lis=d)
147+
check_widget_children(c, lis=d)
148148

149149
def test_list_int():
150150
values = [3, 1, 2]
@@ -158,7 +158,7 @@ def test_list_int():
158158
_options_labels=tuple(str(v) for v in values),
159159
_options_values=tuple(values),
160160
)
161-
check_widgets(c, lis=d)
161+
check_widget_children(c, lis=d)
162162

163163
def test_list_tuple():
164164
values = [(3, 300), (1, 100), (2, 200)]
@@ -172,7 +172,7 @@ def test_list_tuple():
172172
_options_labels=("3", "1", "2"),
173173
_options_values=(300, 100, 200),
174174
)
175-
check_widgets(c, lis=d)
175+
check_widget_children(c, lis=d)
176176

177177
def test_list_tuple_invalid():
178178
for bad in [
@@ -213,7 +213,7 @@ def test_ordereddict():
213213
_options_labels=("3", "1", "2"),
214214
_options_values=(300, 100, 200),
215215
)
216-
check_widgets(c, lis=d)
216+
check_widget_children(c, lis=d)
217217

218218
def test_iterable():
219219
def yield_values():
@@ -230,7 +230,7 @@ def yield_values():
230230
_options_labels=("3", "1", "2"),
231231
_options_values=(3, 1, 2),
232232
)
233-
check_widgets(c, lis=d)
233+
check_widget_children(c, lis=d)
234234

235235
def test_iterable_tuple():
236236
values = [(3, 300), (1, 100), (2, 200)]
@@ -244,7 +244,7 @@ def test_iterable_tuple():
244244
_options_labels=("3", "1", "2"),
245245
_options_values=(300, 100, 200),
246246
)
247-
check_widgets(c, lis=d)
247+
check_widget_children(c, lis=d)
248248

249249
def test_mapping():
250250
from collections.abc import Mapping
@@ -273,7 +273,7 @@ def items(self):
273273
_options_labels=("3", "1", "2"),
274274
_options_values=(300, 100, 200),
275275
)
276-
check_widgets(c, lis=d)
276+
check_widget_children(c, lis=d)
277277

278278
def test_decorator_kwarg(clear_display):
279279
with patch.object(interaction, 'display', record_display):

0 commit comments

Comments
 (0)