Skip to content

Commit 4d916ef

Browse files
jbrockmendelTomAugspurger
authored andcommitted
TST: avoid matplotlib warnings in tests (#26678)
* TST: avoid matplotlib warnings in tests
1 parent cdc07fd commit 4d916ef

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

pandas/tests/plotting/test_frame.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -800,7 +800,10 @@ def test_line_area_stacked(self):
800800
with pytest.raises(ValueError):
801801
mixed_df.plot(stacked=True)
802802

803-
_check_plot_works(df.plot, kind=kind, logx=True, stacked=True)
803+
# Use an index with strictly positive values, preventing
804+
# matplotlib from warning about ignoring xlim
805+
df2 = df.set_index(df.index + 1)
806+
_check_plot_works(df2.plot, kind=kind, logx=True, stacked=True)
804807

805808
def test_line_area_nan_df(self):
806809
values1 = [1, 2, np.nan, 3]

0 commit comments

Comments
 (0)