Skip to content
Prev Previous commit
Next Next commit
Rename apply case type
  • Loading branch information
samuelsinayoko committed Nov 2, 2019
commit 987b3f596e5731d69bd83d42675c49cb22f7ae4b
10 changes: 5 additions & 5 deletions pandas/tests/tseries/offsets/test_offsets.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def test_to_M8():
#####
# DateOffset Tests
#####
OffsetTestCaseList = List[Tuple[int, Dict[datetime, datetime]]]
_ApplyCases = List[Tuple[int, Dict[datetime, datetime]]]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
_ApplyCases = List[Tuple[int, Dict[datetime, datetime]]]
_ApplyCases = List[Tuple[BaseOffset, Dict[datetime, datetime]]]

Kind of tricky but I don't think int is in play at all here but these are rather all BaseOffset subclasses.

This only "works" because there is no stub for pandas.tseries.offsets and all of the instances here resolve to Any. Assumedly if we stubbed that module it would cause failures if this stays as int

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good point. Have just pushed this change.



class Base:
Expand Down Expand Up @@ -742,7 +742,7 @@ def test_onOffset(self):
for offset, d, expected in tests:
assert_onOffset(offset, d, expected)

apply_cases = [] # type: OffsetTestCaseList
apply_cases = [] # type: _ApplyCases
apply_cases.append(
(
BDay(),
Expand Down Expand Up @@ -2630,7 +2630,7 @@ def test_onOffset(self, case):
offset, d, expected = case
assert_onOffset(offset, d, expected)

apply_cases = [] # type: OffsetTestCaseList
apply_cases = [] # type: _ApplyCases
apply_cases.append(
(
CDay(),
Expand Down Expand Up @@ -2877,7 +2877,7 @@ def test_onOffset(self, case):
offset, d, expected = case
assert_onOffset(offset, d, expected)

apply_cases = [] # type: OffsetTestCaseList
apply_cases = [] # type: _ApplyCases
apply_cases.append(
(
CBMonthEnd(),
Expand Down Expand Up @@ -3026,7 +3026,7 @@ def test_onOffset(self, case):
offset, dt, expected = case
assert_onOffset(offset, dt, expected)

apply_cases = [] # type: OffsetTestCaseList
apply_cases = [] # type: _ApplyCases
apply_cases.append(
(
CBMonthBegin(),
Expand Down