Skip to content

Commit

Permalink
Require mpl for Tabulator background_gradient tests
Browse files Browse the repository at this point in the history
  • Loading branch information
philippjfr committed Mar 24, 2024
1 parent 38ab7c7 commit a396599
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion panel/tests/widgets/test_tables.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
from panel.depends import bind
from panel.io.state import set_curdoc
from panel.models.tabulator import CellClickEvent, TableEditEvent
from panel.tests.util import serve_and_request, wait_until
from panel.tests.util import mpl_available, serve_and_request, wait_until
from panel.util import BOKEH_JS_NAT
from panel.widgets import Button, TextInput
from panel.widgets.tables import DataFrame, Tabulator
Expand Down Expand Up @@ -2084,6 +2084,7 @@ def test_tabulator_styling_empty_dataframe(document, comm):
}
}

@mpl_available
def test_tabulator_style_background_gradient(document, comm):
df = pd.DataFrame(np.random.rand(3, 5), columns=list("ABCDE"))
table = Tabulator(df)
Expand All @@ -2095,6 +2096,7 @@ def test_tabulator_style_background_gradient(document, comm):

assert list(model.cell_styles['data'][0]) == [2, 4, 5]

@mpl_available
def test_tabulator_styled_df_with_background_gradient(document, comm):
df = pd.DataFrame(np.random.rand(3, 5), columns=list("ABCDE")).style.background_gradient(
cmap="RdYlGn_r", vmin=0, vmax=0.5, subset=["A", "C", "D"]
Expand Down

0 comments on commit a396599

Please sign in to comment.