File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change 3
3
4
4
"""Test Widget."""
5
5
6
+ from IPython import version_info
6
7
from IPython .core .interactiveshell import InteractiveShell
7
8
from IPython .display import display
8
9
from IPython .utils .capture import capture_output
9
-
10
10
from ..widget import Widget
11
11
12
12
@@ -17,8 +17,13 @@ def test_no_widget_view():
17
17
18
18
with capture_output () as cap :
19
19
w = Widget ()
20
+ msg = w ._repr_mimebundle_ ()
20
21
display (w )
21
22
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
+
23
28
assert cap .stdout == '' , repr (cap .stdout )
24
29
assert cap .stderr == '' , repr (cap .stderr )
You can’t perform that action at this time.
0 commit comments