Skip to content

Commit 31dc4fa

Browse files
committed
Revert xfails for missing MaskedArrays
1 parent 317e042 commit 31dc4fa

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

pandas/tests/plotting/test_datetimelike.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
pass
1212

1313
import numpy as np
14-
from pandas import Index, Series, DataFrame, NaT
14+
from pandas import Index, Series, DataFrame, NaT, isna
1515
from pandas.compat import PY3
1616
from pandas.core.indexes.datetimes import date_range, bdate_range
1717
from pandas.core.indexes.timedeltas import timedelta_range
@@ -581,8 +581,6 @@ def test_finder_hourly(self):
581581
assert rs == xp
582582

583583
@pytest.mark.slow
584-
@pytest.mark.xfail(_mpl_ge_3_0_0,
585-
reason="return type not a masked array anymore?")
586584
def test_gaps(self):
587585
ts = tm.makeTimeSeries()
588586
ts[5:25] = np.nan
@@ -592,6 +590,8 @@ def test_gaps(self):
592590
assert len(lines) == 1
593591
l = lines[0]
594592
data = l.get_xydata()
593+
if _mpl_ge_3_0_0:
594+
data = np.ma.MaskedArray(data, mask=isna(data), fill_value=np.nan)
595595
if not isinstance(data, np.ma.core.MaskedArray):
596596
print(matplotlib.__version__, np.__version__, type(data))
597597
assert isinstance(data, np.ma.core.MaskedArray)
@@ -609,6 +609,8 @@ def test_gaps(self):
609609
assert len(lines) == 1
610610
l = lines[0]
611611
data = l.get_xydata()
612+
if _mpl_ge_3_0_0:
613+
data = np.ma.MaskedArray(data, mask=isna(data), fill_value=np.nan)
612614
if not isinstance(data, np.ma.core.MaskedArray):
613615
print(matplotlib.__version__, np.__version__, type(data))
614616
assert isinstance(data, np.ma.core.MaskedArray)
@@ -626,6 +628,8 @@ def test_gaps(self):
626628
assert len(lines) == 1
627629
l = lines[0]
628630
data = l.get_xydata()
631+
if _mpl_ge_3_0_0:
632+
data = np.ma.MaskedArray(data, mask=isna(data), fill_value=np.nan)
629633
if not isinstance(data, np.ma.core.MaskedArray):
630634
print(matplotlib.__version__, np.__version__, type(data))
631635
print(data)
@@ -634,8 +638,6 @@ def test_gaps(self):
634638
assert mask[2:5, 1].all()
635639

636640
@pytest.mark.slow
637-
@pytest.mark.xfail(_mpl_ge_3_0_0,
638-
reason="return type not a masked array anymore?")
639641
def test_gap_upsample(self):
640642
low = tm.makeTimeSeries()
641643
low[5:25] = np.nan
@@ -650,6 +652,8 @@ def test_gap_upsample(self):
650652
assert len(ax.right_ax.get_lines()) == 1
651653
l = lines[0]
652654
data = l.get_xydata()
655+
if _mpl_ge_3_0_0:
656+
data = np.ma.MaskedArray(data, mask=isna(data), fill_value=np.nan)
653657

654658
if not isinstance(data, np.ma.core.MaskedArray):
655659
print(matplotlib.__version__, np.__version__, type(data))

0 commit comments

Comments
 (0)