@@ -227,56 +227,17 @@ def test_series_comparison_scalars(self):
227227 expected = Series ([x > val for x in series ])
228228 tm .assert_series_equal (result , expected )
229229
230- def test_dt64_ser_cmp_date_warning (self ):
231- # https://github.com/pandas-dev/pandas/issues/21359
232- # Remove this test and enble invalid test below
233- ser = pd .Series (pd .date_range ("20010101" , periods = 10 ), name = "dates" )
234- date = ser .iloc [0 ].to_pydatetime ().date ()
235-
236- with tm .assert_produces_warning (FutureWarning ) as m :
237- result = ser == date
238- expected = pd .Series ([True ] + [False ] * 9 , name = "dates" )
239- tm .assert_series_equal (result , expected )
240- assert "Comparing Series of datetimes " in str (m [0 ].message )
241- assert "will not compare equal" in str (m [0 ].message )
242-
243- with tm .assert_produces_warning (FutureWarning ) as m :
244- result = ser != date
245- tm .assert_series_equal (result , ~ expected )
246- assert "will not compare equal" in str (m [0 ].message )
247-
248- with tm .assert_produces_warning (FutureWarning ) as m :
249- result = ser <= date
250- tm .assert_series_equal (result , expected )
251- assert "a TypeError will be raised" in str (m [0 ].message )
252-
253- with tm .assert_produces_warning (FutureWarning ) as m :
254- result = ser < date
255- tm .assert_series_equal (result , pd .Series ([False ] * 10 , name = "dates" ))
256- assert "a TypeError will be raised" in str (m [0 ].message )
257-
258- with tm .assert_produces_warning (FutureWarning ) as m :
259- result = ser >= date
260- tm .assert_series_equal (result , pd .Series ([True ] * 10 , name = "dates" ))
261- assert "a TypeError will be raised" in str (m [0 ].message )
262-
263- with tm .assert_produces_warning (FutureWarning ) as m :
264- result = ser > date
265- tm .assert_series_equal (result , pd .Series ([False ] + [True ] * 9 , name = "dates" ))
266- assert "a TypeError will be raised" in str (m [0 ].message )
267-
268- @pytest .mark .skip (reason = "GH#21359" )
269230 def test_dt64ser_cmp_date_invalid (self , box_with_array ):
270231 # GH#19800 datetime.date comparison raises to
271232 # match DatetimeIndex/Timestamp. This also matches the behavior
272233 # of stdlib datetime.datetime
273234
274235 ser = pd .date_range ("20010101" , periods = 10 )
275- date = ser . iloc [0 ].to_pydatetime ().date ()
236+ date = ser [0 ].to_pydatetime ().date ()
276237
277238 ser = tm .box_expected (ser , box_with_array )
278- assert not ( ser == date ). any ( )
279- assert (ser != date ). all ( )
239+ assert_all ( ~ ( ser == date ))
240+ assert_all (ser != date )
280241 with pytest .raises (TypeError ):
281242 ser > date
282243 with pytest .raises (TypeError ):
0 commit comments