Skip to content

Commit 0b80ffd

Browse files
committed
REF: import matplotlib in each test where required
1 parent 0822d95 commit 0b80ffd

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

pandas/tests/plotting/test_style.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
from cycler import cycler
2-
import matplotlib as mpl
32
import matplotlib.colors
43
import pytest
54

@@ -20,6 +19,8 @@ class TestGetStandardColors:
2019
],
2120
)
2221
def test_default_colors_named_from_prop_cycle(self, num_colors, expected):
22+
import matplotlib as mpl
23+
2324
mpl_params = {
2425
"axes.prop_cycle": cycler(color=["red", "green", "blue"]),
2526
}
@@ -38,6 +39,8 @@ def test_default_colors_named_from_prop_cycle(self, num_colors, expected):
3839
],
3940
)
4041
def test_default_colors_named_from_prop_cycle_string(self, num_colors, expected):
42+
import matplotlib as mpl
43+
4144
mpl_params = {
4245
"axes.prop_cycle": cycler(color="bgry"),
4346
}
@@ -70,6 +73,8 @@ def test_default_colors_named_from_prop_cycle_string(self, num_colors, expected)
7073
],
7174
)
7275
def test_default_colors_named_undefined_prop_cycle(self, num_colors, expected_name):
76+
import matplotlib as mpl
77+
7378
with mpl.rc_context(rc={}):
7479
expected = [matplotlib.colors.to_hex(x) for x in expected_name]
7580
result = get_standard_colors(num_colors=num_colors)

0 commit comments

Comments
 (0)