@@ -148,27 +148,26 @@ def test_round_minute_freq(self, test_input, freq, expected, rounder):
148
148
result = func (freq )
149
149
assert result == expected
150
150
151
- def test_ceil (self ):
152
- dt = Timestamp ("20130101 09:10:11" )
151
+ @pytest .mark .parametrize ("unit" , ["ns" , "us" , "ms" , "s" ])
152
+ def test_ceil (self , unit ):
153
+ dt = Timestamp ("20130101 09:10:11" )._as_unit (unit )
153
154
result = dt .ceil ("D" )
154
155
expected = Timestamp ("20130102" )
155
156
assert result == expected
157
+ assert result ._reso == dt ._reso
156
158
157
- def test_floor (self ):
158
- dt = Timestamp ("20130101 09:10:11" )
159
+ @pytest .mark .parametrize ("unit" , ["ns" , "us" , "ms" , "s" ])
160
+ def test_floor (self , unit ):
161
+ dt = Timestamp ("20130101 09:10:11" )._as_unit (unit )
159
162
result = dt .floor ("D" )
160
163
expected = Timestamp ("20130101" )
161
164
assert result == expected
165
+ assert result ._reso == dt ._reso
162
166
163
167
@pytest .mark .parametrize ("method" , ["ceil" , "round" , "floor" ])
164
168
@pytest .mark .parametrize (
165
169
"unit" ,
166
- [
167
- "ns" ,
168
- pytest .param ("us" , marks = pytest .mark .xfail (reason = "round not implemented" )),
169
- pytest .param ("ms" , marks = pytest .mark .xfail (reason = "round not implemented" )),
170
- pytest .param ("s" , marks = pytest .mark .xfail (reason = "round not implemented" )),
171
- ],
170
+ ["ns" , "us" , "ms" , "s" ],
172
171
)
173
172
def test_round_dst_border_ambiguous (self , method , unit ):
174
173
# GH 18946 round near "fall back" DST
@@ -203,12 +202,7 @@ def test_round_dst_border_ambiguous(self, method, unit):
203
202
)
204
203
@pytest .mark .parametrize (
205
204
"unit" ,
206
- [
207
- "ns" ,
208
- pytest .param ("us" , marks = pytest .mark .xfail (reason = "round not implemented" )),
209
- pytest .param ("ms" , marks = pytest .mark .xfail (reason = "round not implemented" )),
210
- pytest .param ("s" , marks = pytest .mark .xfail (reason = "round not implemented" )),
211
- ],
205
+ ["ns" , "us" , "ms" , "s" ],
212
206
)
213
207
def test_round_dst_border_nonexistent (self , method , ts_str , freq , unit ):
214
208
# GH 23324 round near "spring forward" DST
0 commit comments