Skip to content

Commit b1c68e7

Browse files
authored
change dict to literal (#38186)
1 parent 2a4d3fe commit b1c68e7

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

pandas/tests/plotting/test_boxplot_method.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -171,11 +171,11 @@ def test_boxplot_numeric_data(self):
171171
"colors_kwd, expected",
172172
[
173173
(
174-
dict(boxes="r", whiskers="b", medians="g", caps="c"),
175-
dict(boxes="r", whiskers="b", medians="g", caps="c"),
174+
{"boxes": "r", "whiskers": "b", "medians": "g", "caps": "c"},
175+
{"boxes": "r", "whiskers": "b", "medians": "g", "caps": "c"},
176176
),
177-
(dict(boxes="r"), dict(boxes="r")),
178-
("r", dict(boxes="r", whiskers="r", medians="r", caps="r")),
177+
({"boxes": "r"}, {"boxes": "r"}),
178+
("r", {"boxes": "r", "whiskers": "r", "medians": "r", "caps": "r"}),
179179
],
180180
)
181181
def test_color_kwd(self, colors_kwd, expected):
@@ -187,7 +187,7 @@ def test_color_kwd(self, colors_kwd, expected):
187187

188188
@pytest.mark.parametrize(
189189
"dict_colors, msg",
190-
[(dict(boxes="r", invalid_key="r"), "invalid key 'invalid_key'")],
190+
[({"boxes": "r", "invalid_key": "r"}, "invalid key 'invalid_key'")],
191191
)
192192
def test_color_kwd_errors(self, dict_colors, msg):
193193
# GH: 26214
@@ -207,7 +207,7 @@ def test_color_kwd_errors(self, dict_colors, msg):
207207
def test_specified_props_kwd(self, props, expected):
208208
# GH 30346
209209
df = DataFrame({k: np.random.random(100) for k in "ABC"})
210-
kwd = {props: dict(color="C1")}
210+
kwd = {props: {"color": "C1"}}
211211
result = df.boxplot(return_type="dict", **kwd)
212212

213213
assert result[expected][0].get_color() == "C1"

0 commit comments

Comments
 (0)