@@ -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 ),
@@ -265,7 +265,7 @@ def test_intersection(self, tz, sort):
265265
266266 # GH 7880
267267 rng4 = date_range ("7/1/2000" , "7/31/2000" , freq = "D" , tz = tz , name = "idx" )
268- expected4 = DatetimeIndex ([], tz = tz , name = "idx" )
268+ expected4 = DatetimeIndex ([], tz = tz , name = "idx" ). as_unit ( "ns" )
269269 assert expected4 .freq is None
270270
271271 for rng , expected in [
@@ -536,7 +536,7 @@ def test_intersection(self):
536536
537537 # non-overlapping
538538 the_int = rng [:10 ].intersection (rng [10 :])
539- expected = DatetimeIndex ([])
539+ expected = DatetimeIndex ([]). as_unit ( "ns" )
540540 tm .assert_index_equal (the_int , expected )
541541
542542 def test_intersection_bug (self ):
0 commit comments