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

Fix hv.help if Info.store is None #6250

Merged
merged 1 commit into from
May 30, 2024
Merged
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 holoviews/core/options.py
Original file line number Diff line number Diff line change
Expand Up @@ -1253,7 +1253,7 @@ def info(cls, obj, ansi=True, backend='matplotlib', visualization=True,
parameterized_class = (isinstance(obj,type)
and issubclass(obj,param.Parameterized))
info = None
if parameterized_object or parameterized_class:
if InfoPrinter.store and (parameterized_object or parameterized_class):
info = InfoPrinter.info(obj, ansi=ansi, backend=backend,
visualization=visualization,
pattern=pattern, elements=elements)
Expand Down
12 changes: 12 additions & 0 deletions holoviews/tests/util/test_help.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,15 @@ def test_help_pattern(capsys):
hv.help(hv.Curve, pattern='border')
captured = capsys.readouterr()
assert '\x1b[43;1;30mborder\x1b[0m' in captured.out


@pytest.mark.usefixtures("bokeh_backend")
def test_help_pattern_no_ipython(capsys):
info_store = hv.core.pprint.InfoPrinter.store
try:
hv.core.pprint.InfoPrinter.store = None
hv.help(hv.Curve)
captured = capsys.readouterr()
assert captured.out.startswith('Help on class Curve')
finally:
hv.core.pprint.InfoPrinter.store = info_store
Loading