We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e2ec195 commit 2248f1dCopy full SHA for 2248f1d
packages/python/plotly/plotly/tests/test_io/test_renderers.py
@@ -388,8 +388,12 @@ def test_missing_webbrowser_module(fig1):
388
"""
389
Assert that no errors occur if the webbrowser module is absent
390
391
- with mock.patch("builtins.__import__", side_effect=ImportError):
392
- fig1._repr_html_()
+ removed_webbrowser_module = sys.modules["webbrowser"]
+ del sys.modules["webbrowser"]
393
+ fig1._repr_html_()
394
+ sys.modules[
395
+ "webbrowser"
396
+ ] = removed_webbrowser_module # restore everything after this test
397
398
399
def test_missing_webbrowser_methods(fig1):
0 commit comments