From: Yaroslav Halchenko Date: Sun, 2 Apr 2017 05:06:36 +0000 (+0000) Subject: BF: skip equivalence test for itemsize and nbytes if "values" ndarray view of type... X-Git-Tag: archive/raspbian/0.19.2-5.1+rpi1^2~11 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=7c126794556f1ca20194cfa0a9e066d99a34de24;p=pandas.git BF: skip equivalence test for itemsize and nbytes if "values" ndarray view of type object Gbp-Pq: Name changeset_848ce49a9f006eadfd169d2fc545a5d15b616f7c.diff --- diff --git a/pandas/tests/indexes/common.py b/pandas/tests/indexes/common.py index 1b373baf..a3205fac 100644 --- a/pandas/tests/indexes/common.py +++ b/pandas/tests/indexes/common.py @@ -127,6 +127,12 @@ class Base(object): 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