@@ -207,57 +207,17 @@ def test_series_comparison_scalars(self):
207
207
expected = Series ([x > val for x in series ])
208
208
tm .assert_series_equal (result , expected )
209
209
210
- def test_dt64_ser_cmp_date_warning (self ):
211
- # https://github.com/pandas-dev/pandas/issues/21359
212
- # Remove this test and enble invalid test below
213
- ser = pd .Series (pd .date_range ('20010101' , periods = 10 ), name = 'dates' )
214
- date = ser .iloc [0 ].to_pydatetime ().date ()
215
-
216
- with tm .assert_produces_warning (FutureWarning ) as m :
217
- result = ser == date
218
- expected = pd .Series ([True ] + [False ] * 9 , name = 'dates' )
219
- tm .assert_series_equal (result , expected )
220
- assert "Comparing Series of datetimes " in str (m [0 ].message )
221
- assert "will not compare equal" in str (m [0 ].message )
222
-
223
- with tm .assert_produces_warning (FutureWarning ) as m :
224
- result = ser != date
225
- tm .assert_series_equal (result , ~ expected )
226
- assert "will not compare equal" in str (m [0 ].message )
227
-
228
- with tm .assert_produces_warning (FutureWarning ) as m :
229
- result = ser <= date
230
- tm .assert_series_equal (result , expected )
231
- assert "a TypeError will be raised" in str (m [0 ].message )
232
-
233
- with tm .assert_produces_warning (FutureWarning ) as m :
234
- result = ser < date
235
- tm .assert_series_equal (result , pd .Series ([False ] * 10 , name = 'dates' ))
236
- assert "a TypeError will be raised" in str (m [0 ].message )
237
-
238
- with tm .assert_produces_warning (FutureWarning ) as m :
239
- result = ser >= date
240
- tm .assert_series_equal (result , pd .Series ([True ] * 10 , name = 'dates' ))
241
- assert "a TypeError will be raised" 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 , pd .Series ([False ] + [True ] * 9 ,
246
- name = 'dates' ))
247
- assert "a TypeError will be raised" in str (m [0 ].message )
248
-
249
- @pytest .mark .skip (reason = "GH#21359" )
250
210
def test_dt64ser_cmp_date_invalid (self , box_with_array ):
251
211
# GH#19800 datetime.date comparison raises to
252
212
# match DatetimeIndex/Timestamp. This also matches the behavior
253
213
# of stdlib datetime.datetime
254
214
255
215
ser = pd .date_range ('20010101' , periods = 10 )
256
- date = ser . iloc [0 ].to_pydatetime ().date ()
216
+ date = ser [0 ].to_pydatetime ().date ()
257
217
258
218
ser = tm .box_expected (ser , box_with_array )
259
- assert not ( ser == date ). any ( )
260
- assert (ser != date ). all ( )
219
+ assert_all ( ~ ( ser == date ))
220
+ assert_all (ser != date )
261
221
with pytest .raises (TypeError ):
262
222
ser > date
263
223
with pytest .raises (TypeError ):
0 commit comments