File: allow_no_matplotlib.patch

package info (click to toggle)
pandas 2.2.3%2Bdfsg-9
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 66,784 kB
  • sloc: python: 422,228; ansic: 9,190; sh: 270; xml: 102; makefile: 83
file content (27 lines) | stat: -rw-r--r-- 1,025 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
Description: Don't try to run matplotlib-using tests without it

This allows the circular pandas <-> matplotlib dependency
to be broken for bootstrapping (see README.source)

Author: Rebecca N. Palmer <rebecca_palmer@zoho.com>
Forwarded: no

--- a/pandas/tests/io/formats/style/test_style.py
+++ b/pandas/tests/io/formats/style/test_style.py
@@ -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