@@ -73,7 +73,7 @@ def test_union(self, tz, sort):
7373 expected2_notsorted = DatetimeIndex (list (other2 ) + list (rng2 [:3 ]))
7474
7575 rng3 = date_range ("1/1/2000" , freq = "D" , periods = 5 , tz = tz )
76- other3 = DatetimeIndex ([], tz = tz )
76+ other3 = DatetimeIndex ([], tz = tz ). as_unit ( "ns" )
7777 expected3 = date_range ("1/1/2000" , freq = "D" , periods = 5 , tz = tz )
7878 expected3_notsorted = rng3
7979
@@ -235,7 +235,7 @@ def test_intersection(self, tz, sort):
235235 expected3 = date_range ("6/1/2000" , "6/20/2000" , freq = "D" , name = None )
236236
237237 rng4 = date_range ("7/1/2000" , "7/31/2000" , freq = "D" , name = "idx" )
238- expected4 = DatetimeIndex ([], freq = "D" , name = "idx" )
238+ expected4 = DatetimeIndex ([], freq = "D" , name = "idx" , dtype = "M8[ns]" )
239239
240240 for rng , expected in [
241241 (rng2 , expected2 ),
@@ -269,7 +269,7 @@ def test_intersection(self, tz, sort):
269269
270270 # GH 7880
271271 rng4 = date_range ("7/1/2000" , "7/31/2000" , freq = "D" , tz = tz , name = "idx" )
272- expected4 = DatetimeIndex ([], tz = tz , name = "idx" )
272+ expected4 = DatetimeIndex ([], tz = tz , name = "idx" ). as_unit ( "ns" )
273273 assert expected4 .freq is None
274274
275275 for rng , expected in [
@@ -540,7 +540,7 @@ def test_intersection(self):
540540
541541 # non-overlapping
542542 the_int = rng [:10 ].intersection (rng [10 :])
543- expected = DatetimeIndex ([])
543+ expected = DatetimeIndex ([]). as_unit ( "ns" )
544544 tm .assert_index_equal (the_int , expected )
545545
546546 def test_intersection_bug (self ):
0 commit comments