From 9d67817ed9176f222ef9566aa487af179c59f416 Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Tue, 3 Jan 2017 15:38:33 +0000 Subject: [PATCH 1/2] BF: define expected Series of correct for arch (eg i386) int --- pandas/tools/tests/test_tile.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pandas/tools/tests/test_tile.py b/pandas/tools/tests/test_tile.py index 5c7cee862ccd3..4fd53c1f696af 100644 --- a/pandas/tools/tests/test_tile.py +++ b/pandas/tools/tests/test_tile.py @@ -288,7 +288,10 @@ def test_qcut_duplicates_bin(self): def test_single_bin(self): # issue 14652 - expected = Series([0, 0]) + # Explicit dtype since Series produces int64 for ints, while cut + # (due to numpy.searchsorted) would use int32 on i386, so let's assure + # correct default to the architecture int + expected = Series([0, 0], dtype='intp') s = Series([9., 9.]) result = cut(s, 1, labels=False) From 11dccee05d3bfee2fceae109940b9944525ab04f Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Wed, 4 Jan 2017 18:58:34 +0000 Subject: [PATCH 2/2] BF: skip equivalence test for itemsize and nbytes if "values" ndarray view of type object --- pandas/tests/indexes/common.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pandas/tests/indexes/common.py b/pandas/tests/indexes/common.py index 1b373baf9b3c1..dd4e0869e9627 100644 --- a/pandas/tests/indexes/common.py +++ b/pandas/tests/indexes/common.py @@ -127,6 +127,13 @@ def test_ndarray_compat_properties(self): values = idx.values for prop in self._compat_props: + # skip equivalency check if converted type is object, as happens + # for PeriodIndex, since then object (address) would be 4 bytes + # on 32bit platforms and equivalence to int64 of original + # date time is just accidental + if prop in ('itemsize', 'nbytes') \ + and values.dtype.name == 'object': + continue self.assertEqual(getattr(idx, prop), getattr(values, prop)) # test for validity