diff options
Diffstat (limited to 'numpy/testing/tests/test_utils.py')
-rw-r--r-- | numpy/testing/tests/test_utils.py | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/numpy/testing/tests/test_utils.py b/numpy/testing/tests/test_utils.py index c3b9e04b6..31d2cdc76 100644 --- a/numpy/testing/tests/test_utils.py +++ b/numpy/testing/tests/test_utils.py @@ -434,10 +434,10 @@ class TestArrayAlmostEqual(_GenericTest): # (which, e.g., astropy Quantity cannot usefully do). See gh-8452. class MyArray(np.ndarray): def __eq__(self, other): - return super(MyArray, self).__eq__(other).view(np.ndarray) + return super().__eq__(other).view(np.ndarray) def __lt__(self, other): - return super(MyArray, self).__lt__(other).view(np.ndarray) + return super().__lt__(other).view(np.ndarray) def all(self, *args, **kwargs): raise NotImplementedError @@ -585,10 +585,10 @@ class TestAlmostEqual(_GenericTest): # (which, e.g., astropy Quantity cannot usefully do). See gh-8452. class MyArray(np.ndarray): def __eq__(self, other): - return super(MyArray, self).__eq__(other).view(np.ndarray) + return super().__eq__(other).view(np.ndarray) def __lt__(self, other): - return super(MyArray, self).__lt__(other).view(np.ndarray) + return super().__lt__(other).view(np.ndarray) def all(self, *args, **kwargs): raise NotImplementedError @@ -904,6 +904,11 @@ class TestAssertAllclose: msg = str(exc_info.value) assert_('Max relative difference: 0.5' in msg) + def test_timedelta(self): + # see gh-18286 + a = np.array([[1, 2, 3, "NaT"]], dtype="m8[ns]") + assert_allclose(a, a) + class TestArrayAlmostEqualNulp: |