1010 BaseCFTimeOffset ,
1111 Day ,
1212 Hour ,
13+ Microsecond ,
14+ Millisecond ,
1315 Minute ,
1416 MonthBegin ,
1517 MonthEnd ,
@@ -181,6 +183,14 @@ def test_to_offset_offset_input(offset):
181183 ("2min" , Minute (n = 2 )),
182184 ("S" , Second ()),
183185 ("2S" , Second (n = 2 )),
186+ ("L" , Millisecond (n = 1 )),
187+ ("2L" , Millisecond (n = 2 )),
188+ ("ms" , Millisecond (n = 1 )),
189+ ("2ms" , Millisecond (n = 2 )),
190+ ("U" , Microsecond (n = 1 )),
191+ ("2U" , Microsecond (n = 2 )),
192+ ("us" , Microsecond (n = 1 )),
193+ ("2us" , Microsecond (n = 2 )),
184194 ],
185195 ids = _id_func ,
186196)
@@ -299,6 +309,8 @@ def test_to_cftime_datetime_error_type_error():
299309 Hour (),
300310 Minute (),
301311 Second (),
312+ Millisecond (),
313+ Microsecond (),
302314]
303315_EQ_TESTS_B = [
304316 BaseCFTimeOffset (n = 2 ),
@@ -316,6 +328,8 @@ def test_to_cftime_datetime_error_type_error():
316328 Hour (n = 2 ),
317329 Minute (n = 2 ),
318330 Second (n = 2 ),
331+ Millisecond (n = 2 ),
332+ Microsecond (n = 2 ),
319333]
320334
321335
@@ -340,6 +354,8 @@ def test_neq(a, b):
340354 Hour (n = 2 ),
341355 Minute (n = 2 ),
342356 Second (n = 2 ),
357+ Millisecond (n = 2 ),
358+ Microsecond (n = 2 ),
343359]
344360
345361
@@ -360,6 +376,8 @@ def test_eq(a, b):
360376 (Hour (), Hour (n = 3 )),
361377 (Minute (), Minute (n = 3 )),
362378 (Second (), Second (n = 3 )),
379+ (Millisecond (), Millisecond (n = 3 )),
380+ (Microsecond (), Microsecond (n = 3 )),
363381]
364382
365383
@@ -387,6 +405,8 @@ def test_rmul(offset, expected):
387405 (Hour (), Hour (n = - 1 )),
388406 (Minute (), Minute (n = - 1 )),
389407 (Second (), Second (n = - 1 )),
408+ (Millisecond (), Millisecond (n = - 1 )),
409+ (Microsecond (), Microsecond (n = - 1 )),
390410 ],
391411 ids = _id_func ,
392412)
@@ -399,6 +419,8 @@ def test_neg(offset, expected):
399419 (Hour (n = 2 ), (1 , 1 , 1 , 2 )),
400420 (Minute (n = 2 ), (1 , 1 , 1 , 0 , 2 )),
401421 (Second (n = 2 ), (1 , 1 , 1 , 0 , 0 , 2 )),
422+ (Millisecond (n = 2 ), (1 , 1 , 1 , 0 , 0 , 0 , 2000 )),
423+ (Microsecond (n = 2 ), (1 , 1 , 1 , 0 , 0 , 0 , 2 )),
402424]
403425
404426
@@ -427,6 +449,8 @@ def test_radd_sub_monthly(offset, expected_date_args, calendar):
427449 (Hour (n = 2 ), (1 , 1 , 2 , 22 )),
428450 (Minute (n = 2 ), (1 , 1 , 2 , 23 , 58 )),
429451 (Second (n = 2 ), (1 , 1 , 2 , 23 , 59 , 58 )),
452+ (Millisecond (n = 2 ), (1 , 1 , 2 , 23 , 59 , 59 , 998000 )),
453+ (Microsecond (n = 2 ), (1 , 1 , 2 , 23 , 59 , 59 , 999998 )),
430454 ],
431455 ids = _id_func ,
432456)
@@ -802,6 +826,8 @@ def test_add_quarter_end_onOffset(
802826 ((1 , 1 , 1 ), Hour (), True ),
803827 ((1 , 1 , 1 ), Minute (), True ),
804828 ((1 , 1 , 1 ), Second (), True ),
829+ ((1 , 1 , 1 ), Millisecond (), True ),
830+ ((1 , 1 , 1 ), Microsecond (), True ),
805831 ],
806832 ids = _id_func ,
807833)
@@ -865,6 +891,8 @@ def test_onOffset_month_or_quarter_or_year_end(
865891 (Hour (), (1 , 3 , 2 , 1 , 1 ), (1 , 3 , 2 , 1 , 1 )),
866892 (Minute (), (1 , 3 , 2 , 1 , 1 , 1 ), (1 , 3 , 2 , 1 , 1 , 1 )),
867893 (Second (), (1 , 3 , 2 , 1 , 1 , 1 , 1 ), (1 , 3 , 2 , 1 , 1 , 1 , 1 )),
894+ (Millisecond (), (1 , 3 , 2 , 1 , 1 , 1 , 1000 ), (1 , 3 , 2 , 1 , 1 , 1 , 1000 )),
895+ (Microsecond (), (1 , 3 , 2 , 1 , 1 , 1 , 1 ), (1 , 3 , 2 , 1 , 1 , 1 , 1 )),
868896 ],
869897 ids = _id_func ,
870898)
@@ -914,6 +942,8 @@ def test_rollforward(calendar, offset, initial_date_args, partial_expected_date_
914942 (Hour (), (1 , 3 , 2 , 1 , 1 ), (1 , 3 , 2 , 1 , 1 )),
915943 (Minute (), (1 , 3 , 2 , 1 , 1 , 1 ), (1 , 3 , 2 , 1 , 1 , 1 )),
916944 (Second (), (1 , 3 , 2 , 1 , 1 , 1 , 1 ), (1 , 3 , 2 , 1 , 1 , 1 , 1 )),
945+ (Millisecond (), (1 , 3 , 2 , 1 , 1 , 1 , 1000 ), (1 , 3 , 2 , 1 , 1 , 1 , 1000 )),
946+ (Microsecond (), (1 , 3 , 2 , 1 , 1 , 1 , 1 ), (1 , 3 , 2 , 1 , 1 , 1 , 1 )),
917947 ],
918948 ids = _id_func ,
919949)
0 commit comments