Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compatibility of tests with ipywidgets 8 beta 1 #191

Open
frenzymadness opened this issue Jan 10, 2022 · 1 comment · Fixed by #192
Open

Compatibility of tests with ipywidgets 8 beta 1 #191

frenzymadness opened this issue Jan 10, 2022 · 1 comment · Fixed by #192

Comments

@frenzymadness
Copy link
Contributor

Hello.

I'm testing also ipywidgets 8 beta 1 and it seems that there is only one problem. The new version of ipywidgets produces a different output in the notebook than what we expect in test_run_all_notebooks[JupyterWidgets.ipynb-opts7]:

>           assert normalized_expected_outputs == normalized_actual_outputs
E           AssertionError: assert [{'data': {'application/vnd.jupyter.widget-view+json': {'model_id': '<MODEL_ID>',\n                                                        'version_major': 2,\n                                                        'version_minor': 0},\n           'text/plain': 'LabelvalueHelloWorld'},\n  'output_type': 'display_data'}] == [{'data': {'application/vnd.jupyter.widget-view+json': {'model_id': '<MODEL_ID>',\n                                                        'version_major': 2,\n                                                        'version_minor': 0},\n           'text/plain': 'LabelvalueHelloWorld'},\n  'execution_count': 1,\n  'output_type': 'execute_result'}]
E             At index 0 diff: {'data': {'application/vnd.jupyter.widget-view+json': {'model_id': '<MODEL_ID>', 'version_major': 2, 'version_minor': 0}, 'text/plain': 'LabelvalueHelloWorld'}, 'output_type': 'display_data'} != {'output_type': 'execute_result', 'data': {'text/plain': 'LabelvalueHelloWorld', 'application/vnd.jupyter.widget-view+json': {'version_major': 2, 'version_minor': 0, 'model_id': '<MODEL_ID>'}}, 'execution_count': 1}
E             Full diff:
E               [
E                {'data': {'application/vnd.jupyter.widget-view+json': {'model_id': '<MODEL_ID>',
E                                                                       'version_major': 2,
E                                                                       'version_minor': 0},
E                          'text/plain': 'LabelvalueHelloWorld'},
E             +   'output_type': 'display_data'},
E             -   'execution_count': 1,
E             -   'output_type': 'execute_result'},
E               ]

nbclient/tests/test_client.py:231: AssertionError
@martinRenou
Copy link
Member

martinRenou commented Jan 10, 2022

I believe this has to do with the change in jupyter-widgets/ipywidgets#2021 and that it's an expected diff. So we'll need to change the test in nbclient (although I am not sure why there is a change in the execution count, maybe there is no execution_count when we show display_data?).

I guess this is only an issue with the test itself, and it shouldn't prevent nbclient to work with ipywidgets 8.

The reason I think this PR is related is because it used to use IPython.display for showing widgets (hence the display_data output). Now in 8.0, it reimplements _repr_mimebundle_ instead, and IPython will use this method for the filling cell output in the execute_result.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants