From 391d46e8b8a49f3c6b8d92a17831fd74ed01133a Mon Sep 17 00:00:00 2001 From: Brock Mendel Date: Sat, 9 Sep 2017 16:06:28 -0700 Subject: [PATCH 1/2] Remove incorrect kwds from DateOffset tests --- pandas/tests/tseries/test_offsets.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/pandas/tests/tseries/test_offsets.py b/pandas/tests/tseries/test_offsets.py index e03b3e0a85e5e..decb5b2a64b02 100644 --- a/pandas/tests/tseries/test_offsets.py +++ b/pandas/tests/tseries/test_offsets.py @@ -111,7 +111,11 @@ def offset_types(self): def _get_offset(self, klass, value=1, normalize=False): # create instance from offset class - if klass is FY5253 or klass is FY5253Quarter: + if klass is FY5253: + klass = klass(n=value, startingMonth=1, weekday=1, + variation='last', + normalize=normalize) + elif klass is FY5253Quarter: klass = klass(n=value, startingMonth=1, weekday=1, qtr_with_extra_week=1, variation='last', normalize=normalize) @@ -2629,7 +2633,7 @@ def test_offset(self): def test_day_of_month(self): dt = datetime(2007, 1, 1) - offset = MonthEnd(day=20) + offset = MonthEnd() result = dt + offset assert result == Timestamp(2007, 1, 31) @@ -3678,7 +3682,7 @@ def test_onOffset(self): 1, startingMonth=8, weekday=WeekDay.THU, qtr_with_extra_week=4) offset_n = FY5253(weekday=WeekDay.TUE, startingMonth=12, - variation="nearest", qtr_with_extra_week=4) + variation="nearest") tests = [ # From Wikipedia From e4f33964a00e6bef4412f58eb8d42126c6cc4989 Mon Sep 17 00:00:00 2001 From: Brock Mendel Date: Sat, 9 Sep 2017 17:49:00 -0700 Subject: [PATCH 2/2] line wrap per reviewer suggestion --- pandas/tests/tseries/test_offsets.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pandas/tests/tseries/test_offsets.py b/pandas/tests/tseries/test_offsets.py index decb5b2a64b02..7e6e85f322fe0 100644 --- a/pandas/tests/tseries/test_offsets.py +++ b/pandas/tests/tseries/test_offsets.py @@ -113,8 +113,7 @@ def _get_offset(self, klass, value=1, normalize=False): # create instance from offset class if klass is FY5253: klass = klass(n=value, startingMonth=1, weekday=1, - variation='last', - normalize=normalize) + variation='last', normalize=normalize) elif klass is FY5253Quarter: klass = klass(n=value, startingMonth=1, weekday=1, qtr_with_extra_week=1, variation='last',