@@ -17,29 +17,29 @@ def test_repeat_range(self, tz_naive_fixture):
17
17
assert result .freq is None
18
18
assert len (result ) == 5 * len (rng )
19
19
20
- def test_repeat_range2 (self , tz_naive_fixture ):
20
+ def test_repeat_range2 (self , tz_naive_fixture , unit ):
21
21
tz = tz_naive_fixture
22
- index = date_range ("2001-01-01" , periods = 2 , freq = "D" , tz = tz )
22
+ index = date_range ("2001-01-01" , periods = 2 , freq = "D" , tz = tz , unit = unit )
23
23
exp = DatetimeIndex (
24
24
["2001-01-01" , "2001-01-01" , "2001-01-02" , "2001-01-02" ], tz = tz
25
- )
25
+ ). as_unit ( unit )
26
26
for res in [index .repeat (2 ), np .repeat (index , 2 )]:
27
27
tm .assert_index_equal (res , exp )
28
28
assert res .freq is None
29
29
30
- def test_repeat_range3 (self , tz_naive_fixture ):
30
+ def test_repeat_range3 (self , tz_naive_fixture , unit ):
31
31
tz = tz_naive_fixture
32
- index = date_range ("2001-01-01" , periods = 2 , freq = "2D" , tz = tz )
32
+ index = date_range ("2001-01-01" , periods = 2 , freq = "2D" , tz = tz , unit = unit )
33
33
exp = DatetimeIndex (
34
34
["2001-01-01" , "2001-01-01" , "2001-01-03" , "2001-01-03" ], tz = tz
35
- )
35
+ ). as_unit ( unit )
36
36
for res in [index .repeat (2 ), np .repeat (index , 2 )]:
37
37
tm .assert_index_equal (res , exp )
38
38
assert res .freq is None
39
39
40
- def test_repeat_range4 (self , tz_naive_fixture ):
40
+ def test_repeat_range4 (self , tz_naive_fixture , unit ):
41
41
tz = tz_naive_fixture
42
- index = DatetimeIndex (["2001-01-01" , "NaT" , "2003-01-01" ], tz = tz )
42
+ index = DatetimeIndex (["2001-01-01" , "NaT" , "2003-01-01" ], tz = tz ). as_unit ( unit )
43
43
exp = DatetimeIndex (
44
44
[
45
45
"2001-01-01" ,
@@ -53,17 +53,17 @@ def test_repeat_range4(self, tz_naive_fixture):
53
53
"2003-01-01" ,
54
54
],
55
55
tz = tz ,
56
- )
56
+ ). as_unit ( unit )
57
57
for res in [index .repeat (3 ), np .repeat (index , 3 )]:
58
58
tm .assert_index_equal (res , exp )
59
59
assert res .freq is None
60
60
61
- def test_repeat (self , tz_naive_fixture ):
61
+ def test_repeat (self , tz_naive_fixture , unit ):
62
62
tz = tz_naive_fixture
63
63
reps = 2
64
64
msg = "the 'axis' parameter is not supported"
65
65
66
- rng = date_range (start = "2016-01-01" , periods = 2 , freq = "30Min" , tz = tz )
66
+ rng = date_range (start = "2016-01-01" , periods = 2 , freq = "30Min" , tz = tz , unit = unit )
67
67
68
68
expected_rng = DatetimeIndex (
69
69
[
@@ -72,7 +72,7 @@ def test_repeat(self, tz_naive_fixture):
72
72
Timestamp ("2016-01-01 00:30:00" , tz = tz ),
73
73
Timestamp ("2016-01-01 00:30:00" , tz = tz ),
74
74
]
75
- )
75
+ ). as_unit ( unit )
76
76
77
77
res = rng .repeat (reps )
78
78
tm .assert_index_equal (res , expected_rng )
0 commit comments