Skip to content

Commit 1fb8776

Browse files
committed
Fix test failures
1 parent 7dd601b commit 1fb8776

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

ipywidgets/widgets/tests/test_interaction.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -472,8 +472,8 @@ def test_call_decorated_on_trait_change(clear_display):
472472
def foo(a='default'):
473473
d['a'] = a
474474
return a
475-
assert len(displayed) == 1
476-
w = displayed[0].children[0]
475+
assert len(displayed) == 2 # display the result and the interact
476+
w = displayed[1].children[0]
477477
check_widget(w,
478478
cls=widgets.Text,
479479
value='default',
@@ -487,7 +487,7 @@ def foo(a='default'):
487487
with patch.object(interaction, 'display', record_display):
488488
w.value = 'called'
489489
assert d['a'] == 'called'
490-
assert len(displayed) == 2
490+
assert len(displayed) == 3
491491
assert w.value == displayed[-1]
492492

493493
def test_call_decorated_kwargs_on_trait_change(clear_display):
@@ -498,8 +498,8 @@ def test_call_decorated_kwargs_on_trait_change(clear_display):
498498
def foo(a='default'):
499499
d['a'] = a
500500
return a
501-
assert len(displayed) == 1
502-
w = displayed[0].children[0]
501+
assert len(displayed) == 2 # display the result and the interact
502+
w = displayed[1].children[0]
503503
check_widget(w,
504504
cls=widgets.Text,
505505
value='kwarg',
@@ -513,7 +513,7 @@ def foo(a='default'):
513513
with patch.object(interaction, 'display', record_display):
514514
w.value = 'called'
515515
assert d['a'] == 'called'
516-
assert len(displayed) == 2
516+
assert len(displayed) == 3
517517
assert w.value == displayed[-1]
518518

519519

ipywidgets/widgets/tests/utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@ def close(self, *args, **kwargs):
2727
def setup_test_comm():
2828
_widget_attrs['_comm_default'] = getattr(Widget, '_comm_default', undefined)
2929
Widget._comm_default = lambda self: DummyComm()
30-
_widget_attrs['_ipython_display_'] = Widget._ipython_display_
30+
_widget_attrs['_repr_mimebundle_'] = Widget._repr_mimebundle_
3131
def raise_not_implemented(*args, **kwargs):
3232
raise NotImplementedError()
33-
Widget._ipython_display_ = raise_not_implemented
33+
Widget._repr_mimebundle_ = raise_not_implemented
3434

3535
def teardown_test_comm():
3636
for attr, value in _widget_attrs.items():

0 commit comments

Comments
 (0)