MCPcopy Create free account
hub / github.com/holoviz/hvplot / test_interactive_pandas_series_plot

Function test_interactive_pandas_series_plot

hvplot/tests/testinteractive.py:1099–1139  ·  view source on GitHub ↗
(series, clone_spy)

Source from the content-addressed store, hash-verified

1097
1098
1099def test_interactive_pandas_series_plot(series, clone_spy):
1100 si = Interactive(series)
1101
1102 si = si.plot()
1103
1104 assert isinstance(si, Interactive)
1105 assert isinstance(si._current, matplotlib.axes.Axes)
1106 assert si._obj is series
1107 assert "dim('*').pd.plot(ax=<function Interactive._get_ax_fn.<locals>.get_ax" in repr(
1108 si._transform
1109 )
1110 assert si._depth == 3
1111 assert si._method is None
1112
1113 assert clone_spy.count == 3
1114
1115 # _clone(True) in _resolve_accessor in __getattribute__(name='plot')
1116 assert clone_spy.calls[0].depth == 1
1117 assert not clone_spy.calls[0].args
1118 assert clone_spy.calls[0].kwargs == {'copy': True}
1119
1120 # 1st _clone(copy=True) in __call__
1121 assert clone_spy.calls[1].depth == 2
1122 assert not clone_spy.calls[1].args
1123 assert clone_spy.calls[1].kwargs == {'copy': True}
1124
1125 # 2nd _clone in __call__
1126 assert clone_spy.calls[2].depth == 3
1127 assert len(clone_spy.calls[2].args) == 1
1128 # Not the complete repr as the function doesn't have a nice repr,
1129 # its repr displays the memory address.
1130 assert "dim('*').pd.plot(ax=<function Interactive._get_ax_fn.<locals>.get_ax" in repr(
1131 clone_spy.calls[2].args[0]
1132 )
1133 assert clone_spy.calls[2].kwargs == {'plot': True}
1134
1135 assert not si._dmap
1136 assert isinstance(si._fig, matplotlib.figure.Figure)
1137
1138 # Just test that it doesn't raise any error.
1139 si.output()
1140
1141
1142def test_interactive_pandas_series_plot_kind_attr(series, clone_spy):

Callers

nothing calls this directly

Calls 2

outputMethod · 0.95
InteractiveClass · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…