File tree 1 file changed +20
-4
lines changed
python/ipywidgets/ipywidgets/widgets/tests
1 file changed +20
-4
lines changed Original file line number Diff line number Diff line change @@ -202,14 +202,14 @@ def test_append_display_data():
202
202
203
203
# Now try appending an Image.
204
204
image_data = b"foobar"
205
- image_data_b64 = 'Zm9vYmFy\n '
206
205
207
206
widget .append_display_data (Image (image_data , width = 123 , height = 456 ))
208
- expected += (
207
+ # Old ipykernel/IPython
208
+ expected1 = expected + (
209
209
{
210
210
'output_type' : 'display_data' ,
211
211
'data' : {
212
- 'image/png' : image_data_b64 ,
212
+ 'image/png' : 'Zm9vYmFy \n ' ,
213
213
'text/plain' : '<IPython.core.display.Image object>'
214
214
},
215
215
'metadata' : {
@@ -220,4 +220,20 @@ def test_append_display_data():
220
220
}
221
221
},
222
222
)
223
- assert widget .outputs == expected , repr (widget .outputs )
223
+ # Latest ipykernel/IPython
224
+ expected2 = expected + (
225
+ {
226
+ 'output_type' : 'display_data' ,
227
+ 'data' : {
228
+ 'image/png' : 'Zm9vYmFy' ,
229
+ 'text/plain' : '<IPython.core.display.Image object>'
230
+ },
231
+ 'metadata' : {
232
+ 'image/png' : {
233
+ 'width' : 123 ,
234
+ 'height' : 456
235
+ }
236
+ }
237
+ },
238
+ )
239
+ assert widget .outputs == expected1 or widget .outputs == expected2
You can’t perform that action at this time.
0 commit comments