Skip to content

Commit cdc7ffd

Browse files
committed
Run black
1 parent 74968c1 commit cdc7ffd

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

Diff for: packages/python/plotly/plotly/tests/test_io/test_renderers.py

+7-2
Original file line numberDiff line numberDiff line change
@@ -398,11 +398,16 @@ def webbrowser_absent_import(name, globals, locals, fromlist, level):
398398
"""
399399
Mimick an absent webbrowser module
400400
"""
401-
if name == 'webbrowser':
401+
if name == "webbrowser":
402402
raise ImportError
403403
return realimport(name, globals, locals, fromlist, level)
404-
404+
405405
with mock.patch("builtins.__import__", webbrowser_absent_import):
406+
# 1: check whether importing webbrowser actually results in an ImportError
407+
with pytest.raises(ImportError):
408+
import webbrowser
409+
410+
# 2: check whether the _repr_html_ can handle it regardless
406411
fig1._repr_html_()
407412

408413

0 commit comments

Comments
 (0)