File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed
packages/python/plotly/plotly/tests/test_io Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -381,3 +381,24 @@ def test_repr_mimebundle_mixed_renderer(fig1):
381381 assert set (fig1 ._repr_mimebundle_ ().keys ()) == set (
382382 {"application/vnd.plotly.v1+json" , "text/html" }
383383 )
384+
385+
386+ def test_missing_webbrowser_module (fig1 ):
387+ """
388+ Assert that no errors occur if the webbrowser module is absent
389+ """
390+ removed_webbrowser_module = sys .modules ['webbrowser' ]
391+ del sys .modules ['webbrowser' ]
392+ fig1 ._repr_html_ ()
393+ sys .modules ['webbrowser' ] = removed_webbrowser_module # restore everything after this test
394+
395+
396+ def test_missing_webbrowser_methods (fig1 ):
397+ """
398+ Assert that no errors occur if the webbrowser module does not contain some methods
399+ """
400+ import webbrowser
401+ removed_webbrowser_get_method = webbrowser .get
402+ del webbrowser .get
403+ fig1 ._repr_html_ ()
404+ webbrowser .get = removed_webbrowser_get_method # restore everything after this test
You can’t perform that action at this time.
0 commit comments