Skip to content

Commit f018ee8

Browse files
committed
Correct tests.
1 parent c4dbc11 commit f018ee8

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

ipywidgets/widgets/tests/test_widget.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33

44
"""Test Widget."""
55

6+
from IPython import version_info
67
from IPython.core.interactiveshell import InteractiveShell
78
from IPython.display import display
89
from IPython.utils.capture import capture_output
9-
1010
from ..widget import Widget
1111

1212

@@ -17,8 +17,13 @@ def test_no_widget_view():
1717

1818
with capture_output() as cap:
1919
w = Widget()
20+
msg = w._repr_mimebundle_()
2021
display(w)
2122

22-
assert cap.outputs == [], repr(cap.outputs)
23+
if version_info[0] > 6 or (version_info[0] == 6 and version_info[1] >= 1):
24+
assert len(cap.outputs) == 1 and cap.outputs[0].data == msg, repr(cap.outputs)
25+
else:
26+
assert cap.outputs == [], repr(cap.outputs)
27+
2328
assert cap.stdout == '', repr(cap.stdout)
2429
assert cap.stderr == '', repr(cap.stderr)

0 commit comments

Comments
 (0)