From a393695da12a7e570c5482ce2823f009aa0a3d2b Mon Sep 17 00:00:00 2001 From: Jeff Reback Date: Sun, 10 Mar 2019 17:22:03 -0400 Subject: [PATCH 1/2] TST: xref #25630 skip on PY2 & old numpy for masked arrays --- pandas/tests/frame/test_constructors.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pandas/tests/frame/test_constructors.py b/pandas/tests/frame/test_constructors.py index 92ce6369a5109..5fb12842a3716 100644 --- a/pandas/tests/frame/test_constructors.py +++ b/pandas/tests/frame/test_constructors.py @@ -684,7 +684,7 @@ def test_constructor_ndarray(self): frame = DataFrame(['foo', 'bar'], index=[0, 1], columns=['A']) assert len(frame) == 2 - @pytest.mark.skipif(PY2 & _np_version_under1p13, + @pytest.mark.skipif(PY2 and _np_version_under1p13, reason="old numpy & py2") def test_constructor_maskedarray(self): self._check_basic_constructor(ma.masked_all) @@ -702,6 +702,8 @@ def test_constructor_maskedarray(self): frame = DataFrame(mat, columns=['A', 'B', 'C'], index=[1, 2]) assert np.all(~np.asarray(frame == frame)) + @pytest.mark.skipif(PY2 and _np_version_under1p13, + reason="old numpy & py2") def test_constructor_maskedarray_nonfloat(self): # masked int promoted to float mat = ma.masked_all((2, 3), dtype=int) @@ -769,6 +771,8 @@ def test_constructor_maskedarray_nonfloat(self): assert frame['A'][1] is True assert frame['C'][2] is False + @pytest.mark.skipif(PY2 and _np_version_under1p13, + reason="old numpy & py2") def test_constructor_maskedarray_hardened(self): # Check numpy masked arrays with hard masks -- from GH24574 mat_hard = ma.masked_all((2, 2), dtype=float).harden_mask() @@ -791,6 +795,8 @@ def test_constructor_maskedarray_hardened(self): dtype=float) tm.assert_frame_equal(result, expected) + @pytest.mark.skipif(PY2 and _np_version_under1p13, + reason="old numpy & py2") def test_constructor_maskedrecarray_dtype(self): # Ensure constructor honors dtype data = np.ma.array( From 51f048afdb8233ca54ba58b1f7fc8d9a629073bb Mon Sep 17 00:00:00 2001 From: Jeff Reback Date: Sun, 10 Mar 2019 18:18:59 -0400 Subject: [PATCH 2/2] suppress moar --- pandas/tests/frame/test_constructors.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pandas/tests/frame/test_constructors.py b/pandas/tests/frame/test_constructors.py index 5fb12842a3716..1d5cbfec8de52 100644 --- a/pandas/tests/frame/test_constructors.py +++ b/pandas/tests/frame/test_constructors.py @@ -808,6 +808,8 @@ def test_constructor_maskedrecarray_dtype(self): columns=['date', 'price']) tm.assert_frame_equal(result, expected) + @pytest.mark.skipif(PY2 and _np_version_under1p13, + reason="old numpy & py2") def test_constructor_mrecarray(self): # Ensure mrecarray produces frame identical to dict of masked arrays # from GH3479