55from numpy import nan
66import pytest
77
8+ from pandas .compat .numpy import _np_version_under1p18
89import pandas .util ._test_decorators as td
910
1011import pandas as pd
@@ -160,6 +161,9 @@ def test_cummax(self, datetime_series):
160161
161162 tm .assert_series_equal (result , expected )
162163
164+ @pytest .mark .xfail (
165+ not _np_version_under1p18 , reason = "numpy 1.18 changed min/max behavior for NaT"
166+ )
163167 def test_cummin_datetime64 (self ):
164168 s = pd .Series (
165169 pd .to_datetime (["NaT" , "2000-1-2" , "NaT" , "2000-1-1" , "NaT" , "2000-1-3" ])
@@ -179,6 +183,9 @@ def test_cummin_datetime64(self):
179183 result = s .cummin (skipna = False )
180184 tm .assert_series_equal (expected , result )
181185
186+ @pytest .mark .xfail (
187+ not _np_version_under1p18 , reason = "numpy 1.18 changed min/max behavior for NaT"
188+ )
182189 def test_cummax_datetime64 (self ):
183190 s = pd .Series (
184191 pd .to_datetime (["NaT" , "2000-1-2" , "NaT" , "2000-1-1" , "NaT" , "2000-1-3" ])
@@ -198,6 +205,9 @@ def test_cummax_datetime64(self):
198205 result = s .cummax (skipna = False )
199206 tm .assert_series_equal (expected , result )
200207
208+ @pytest .mark .xfail (
209+ not _np_version_under1p18 , reason = "numpy 1.18 changed min/max behavior for NaT"
210+ )
201211 def test_cummin_timedelta64 (self ):
202212 s = pd .Series (pd .to_timedelta (["NaT" , "2 min" , "NaT" , "1 min" , "NaT" , "3 min" ]))
203213
@@ -213,6 +223,9 @@ def test_cummin_timedelta64(self):
213223 result = s .cummin (skipna = False )
214224 tm .assert_series_equal (expected , result )
215225
226+ @pytest .mark .xfail (
227+ not _np_version_under1p18 , reason = "numpy 1.18 changed min/max behavior for NaT"
228+ )
216229 def test_cummax_timedelta64 (self ):
217230 s = pd .Series (pd .to_timedelta (["NaT" , "2 min" , "NaT" , "1 min" , "NaT" , "3 min" ]))
218231
0 commit comments