Skip to content

Commit caca8bc

Browse files
authored
backport of 25643, 25638 on 0.24.x (pandas-dev#25645)
* TST: failing wheel building on PY2 and old numpy (pandas-dev#25631) closes pandas-dev#25630 * TST: xref pandas-dev#25630 (pandas-dev#25643) * TST: xref pandas-dev#25630 * add PY2 import
1 parent d052978 commit caca8bc

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

pandas/tests/frame/test_constructors.py

+12-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
import pytest
1212

1313
from pandas.compat import (
14-
PY3, PY36, OrderedDict, is_platform_little_endian, lmap, long, lrange,
14+
PY2, PY3, PY36, OrderedDict, is_platform_little_endian, lmap, long, lrange,
1515
lzip, range, zip)
1616

1717
from pandas.core.dtypes.cast import construct_1d_object_array_from_listlike
@@ -20,7 +20,7 @@
2020
import pandas as pd
2121
from pandas import (
2222
Categorical, DataFrame, Index, MultiIndex, Series, Timedelta, Timestamp,
23-
compat, date_range, isna)
23+
_np_version_under1p13, compat, date_range, isna)
2424
from pandas.tests.frame.common import TestData
2525
import pandas.util.testing as tm
2626

@@ -682,6 +682,8 @@ def test_constructor_ndarray(self):
682682
frame = DataFrame(['foo', 'bar'], index=[0, 1], columns=['A'])
683683
assert len(frame) == 2
684684

685+
@pytest.mark.skipif(PY2 and _np_version_under1p13,
686+
reason="old numpy & py2")
685687
def test_constructor_maskedarray(self):
686688
self._check_basic_constructor(ma.masked_all)
687689

@@ -698,6 +700,8 @@ def test_constructor_maskedarray(self):
698700
frame = DataFrame(mat, columns=['A', 'B', 'C'], index=[1, 2])
699701
assert np.all(~np.asarray(frame == frame))
700702

703+
@pytest.mark.skipif(PY2 and _np_version_under1p13,
704+
reason="old numpy & py2")
701705
def test_constructor_maskedarray_nonfloat(self):
702706
# masked int promoted to float
703707
mat = ma.masked_all((2, 3), dtype=int)
@@ -765,6 +769,8 @@ def test_constructor_maskedarray_nonfloat(self):
765769
assert frame['A'][1] is True
766770
assert frame['C'][2] is False
767771

772+
@pytest.mark.skipif(PY2 and _np_version_under1p13,
773+
reason="old numpy & py2")
768774
def test_constructor_maskedarray_hardened(self):
769775
# Check numpy masked arrays with hard masks -- from GH24574
770776
mat_hard = ma.masked_all((2, 2), dtype=float).harden_mask()
@@ -787,6 +793,8 @@ def test_constructor_maskedarray_hardened(self):
787793
dtype=float)
788794
tm.assert_frame_equal(result, expected)
789795

796+
@pytest.mark.skipif(PY2 and _np_version_under1p13,
797+
reason="old numpy & py2")
790798
def test_constructor_maskedrecarray_dtype(self):
791799
# Ensure constructor honors dtype
792800
data = np.ma.array(
@@ -798,6 +806,8 @@ def test_constructor_maskedrecarray_dtype(self):
798806
columns=['date', 'price'])
799807
tm.assert_frame_equal(result, expected)
800808

809+
@pytest.mark.skipif(PY2 and _np_version_under1p13,
810+
reason="old numpy & py2")
801811
def test_constructor_mrecarray(self):
802812
# Ensure mrecarray produces frame identical to dict of masked arrays
803813
# from GH3479

0 commit comments

Comments
 (0)