File tree Expand file tree Collapse file tree 1 file changed +20
-4
lines changed
python/ipywidgets/ipywidgets/widgets/tests Expand file tree Collapse file tree 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():
202202
203203 # Now try appending an Image.
204204 image_data = b"foobar"
205- image_data_b64 = 'Zm9vYmFy\n '
206205
207206 widget .append_display_data (Image (image_data , width = 123 , height = 456 ))
208- expected += (
207+ # Old ipykernel/IPython
208+ expected1 = expected + (
209209 {
210210 'output_type' : 'display_data' ,
211211 'data' : {
212- 'image/png' : image_data_b64 ,
212+ 'image/png' : 'Zm9vYmFy \n ' ,
213213 'text/plain' : '<IPython.core.display.Image object>'
214214 },
215215 'metadata' : {
@@ -220,4 +220,20 @@ def test_append_display_data():
220220 }
221221 },
222222 )
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