Don't try to run matplotlib-using tests without it
authorDebian Science Team <debian-science-maintainers@lists.alioth.debian.org>
Sun, 2 Feb 2025 11:17:13 +0000 (11:17 +0000)
committerPeter Michael Green <plugwash@raspbian.org>
Sun, 2 Feb 2025 11:17:13 +0000 (11:17 +0000)
Author: Rebecca N. Palmer <rebecca_palmer@zoho.com>
Forwarded: no

Gbp-Pq: Name allow_no_matplotlib.patch

pandas/tests/io/formats/style/test_style.py

index 6fa72bd48031cca999b81cccfcedafcd3abcd924..3e231e37d1dd67c9c03d4d7f42bdaa1303df6d7a 100644 (file)
@@ -14,6 +14,7 @@ from pandas import (
     option_context,
 )
 import pandas._testing as tm
+import pandas.util._test_decorators as td
 
 jinja2 = pytest.importorskip("jinja2")
 from pandas.io.formats.style import (  # isort:skip
@@ -756,7 +757,7 @@ class TestStyler:
         df.style.map(color_negative_red, subset=pct_subset)
 
     @pytest.mark.parametrize(
-        "stylefunc", ["background_gradient", "bar", "text_gradient"]
+        "stylefunc", [pytest.param("background_gradient", marks=td.skip_if_no("matplotlib")), "bar", pytest.param("text_gradient", marks=td.skip_if_no("matplotlib"))]
     )
     def test_subset_for_boolean_cols(self, stylefunc):
         # GH47838