Skip to content

Fix issue with default renderer when ipython is installed #5258

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion plotly/io/_renderers.py
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,7 @@ def show(fig, renderer=None, validate=True, **kwargs):
)

default_renderer = env_renderer
elif ipython:
elif ipython and ipython.get_ipython():
# Try to detect environment so that we can enable a useful
# default renderer
if not default_renderer:
Expand Down
7 changes: 7 additions & 0 deletions tests/test_io/test_renderers.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,13 @@ def fig1(request):
)


def test_default_renderer():
"""
The default renderer should be 'browser'.
"""
assert pio.renderers.default == "browser"


# JSON
# ----
def test_json_renderer_mimetype(fig1):
Expand Down