Skip to content

Commit cbea15a

Browse files
committed
adj tests
1 parent 92eb5fd commit cbea15a

File tree

1 file changed

+10
-14
lines changed

1 file changed

+10
-14
lines changed

pandas/tests/io/formats/test_style.py

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1170,15 +1170,12 @@ def test_highlight_quantile(self, kwargs):
11701170
assert result == expected
11711171

11721172
@pytest.mark.parametrize(
1173-
"f",
1173+
"f,kwargs",
11741174
[
1175-
{"f": "highlight_min", "kw": {"axis": 1, "subset": pd.IndexSlice[1, :]}},
1176-
{"f": "highlight_max", "kw": {"axis": 0, "subset": [0]}},
1177-
{
1178-
"f": "highlight_quantile",
1179-
"kw": {"axis": None, "q_low": 0.6, "q_high": 0.8},
1180-
},
1181-
{"f": "highlight_range", "kw": {"subset": [0]}},
1175+
("highlight_min", {"axis": 1, "subset": pd.IndexSlice[1, :]}),
1176+
("highlight_max", {"axis": 0, "subset": [0]}),
1177+
("highlight_quantile", {"axis": None, "q_low": 0.6, "q_high": 0.8}),
1178+
("highlight_range", {"subset": [0]}),
11821179
],
11831180
)
11841181
@pytest.mark.parametrize(
@@ -1191,15 +1188,14 @@ def test_highlight_quantile(self, kwargs):
11911188
DataFrame([[0, 1], [2, 3]], dtype="timedelta64[ns]"),
11921189
],
11931190
)
1194-
def test_all_highlight_dtypes(self, f, df):
1195-
func = f["f"]
1196-
if func == "highlight_quantile" and isinstance(df.iloc[0, 0], str):
1191+
def test_all_highlight_dtypes(self, f, kwargs, df):
1192+
if f == "highlight_quantile" and isinstance(df.iloc[0, 0], str):
11971193
return None # quantile incompatible with str
1198-
elif func == "highlight_range":
1199-
f["kw"]["start"] = df.iloc[1, 0] # set the range low for testing
1194+
elif f == "highlight_range":
1195+
kwargs["start"] = df.iloc[1, 0] # set the range low for testing
12001196

12011197
expected = {(1, 0): [("background-color", "yellow")]}
1202-
result = getattr(df.style, func)(**f["kw"])._compute().ctx
1198+
result = getattr(df.style, f)(**kwargs)._compute().ctx
12031199
assert result == expected
12041200

12051201
def test_export(self):

0 commit comments

Comments
 (0)