def test_ops(self):
        for op in ['max', 'min']:
            for o in self.objs:
                result = getattr(o, op)()
                if not isinstance(o, PeriodIndex):
                    expected = getattr(o.values, op)()
                else:
                    expected = pd.Period(ordinal=getattr(o.values, op)(),
                                         freq=o.freq)
                try:
                    self.assertEqual(result, expected)
                except __HOLE__:
                    # comparing tz-aware series with np.array results in
                    # TypeError
                    expected = expected.astype('M8[ns]').astype('int64')
                    self.assertEqual(result.value, expected)
dataset/ETHPy150Open pydata/pandas/pandas/tests/test_base.py/TestIndexOps.test_ops