Skip to content

Commit e3d18b4

Browse files
GH1089 PR Feedback
1 parent 7818dea commit e3d18b4

File tree

1 file changed

+19
-8
lines changed

1 file changed

+19
-8
lines changed

tests/test_plotting.py

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
Union,
66
)
77

8+
import matplotlib as mpl
89
from matplotlib.axes import Axes
910
from matplotlib.figure import Figure
1011
import matplotlib.pyplot as plt
@@ -13,6 +14,7 @@
1314
import numpy.typing as npt
1415
import pandas as pd
1516
from pandas import Series
17+
from pandas.util.version import Version
1618
import pytest
1719
from typing_extensions import assert_type
1820

@@ -577,13 +579,22 @@ def test_plot_keywords(close_figures):
577579
)
578580

579581
df = pd.DataFrame(np.random.rand(10, 5), columns=["A", "B", "C", "D", "E"])
580-
check(
581-
assert_type(
582-
df.plot(kind="box", orientation="vertical", positions=[1, 4, 5, 6, 8]),
582+
if Version(mpl.__version__) >= Version("3.10.1"):
583+
check(
584+
assert_type(
585+
df.plot(kind="box", orientation="vertical", positions=[1, 4, 5, 6, 8]),
586+
Axes,
587+
),
583588
Axes,
584-
),
585-
Axes,
586-
)
589+
)
590+
else:
591+
check(
592+
assert_type(
593+
df.plot(kind="box", vert=False, positions=[1, 4, 5, 6, 8]),
594+
Axes,
595+
),
596+
Axes,
597+
)
587598

588599

589600
def test_plot_subplot_changes_150() -> None:
@@ -609,7 +620,7 @@ def test_grouped_dataframe_boxplot(close_figures):
609620
check(assert_type(grouped.boxplot(subplots=True), Series), Series)
610621

611622
# a single plot
612-
if not PD_LTE_22:
623+
if not PD_LTE_22 and Version(mpl.__version__) >= Version("3.10.1"):
613624
check(
614625
assert_type(
615626
grouped.boxplot(
@@ -654,7 +665,7 @@ def test_grouped_dataframe_boxplot_single(close_figures):
654665
Axes,
655666
)
656667

657-
if not PD_LTE_22:
668+
if not PD_LTE_22 and Version(mpl.__version__) >= Version("3.10.1"):
658669
check(
659670
assert_type(
660671
grouped.boxplot(

0 commit comments

Comments
 (0)