Skip to content

Commit a4ece6f

Browse files
committed
STY: Added zip strict to pandas/tests/tseries
Added 'strict=True' parameter to zip calls for better error handling
1 parent 704d990 commit a4ece6f

File tree

2 files changed

+12
-8
lines changed

2 files changed

+12
-8
lines changed

pandas/tests/tseries/offsets/test_month.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ def test_offset_whole_year(self):
6161
datetime(2008, 12, 31),
6262
)
6363

64-
for base, exp_date in zip(dates[:-1], dates[1:]):
64+
for base, exp_date in zip(dates[:-1], dates[1:], strict=True):
6565
assert_offset_equal(SemiMonthEnd(), base, exp_date)
6666

6767
# ensure .apply_index works as expected
@@ -312,7 +312,7 @@ def test_offset_whole_year(self):
312312
datetime(2008, 12, 15),
313313
)
314314

315-
for base, exp_date in zip(dates[:-1], dates[1:]):
315+
for base, exp_date in zip(dates[:-1], dates[1:], strict=True):
316316
assert_offset_equal(SemiMonthBegin(), base, exp_date)
317317

318318
# ensure .apply_index works as expected

pandas/tests/tseries/offsets/test_offsets.py

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -636,9 +636,9 @@ def test_copy(self):
636636

637637
@pytest.mark.parametrize(
638638
"arithmatic_offset_type, expected",
639-
zip(
640-
_ARITHMETIC_DATE_OFFSET,
641-
[
639+
zip(
640+
_ARITHMETIC_DATE_OFFSET,
641+
[
642642
"2009-01-02",
643643
"2008-02-02",
644644
"2008-01-09",
@@ -649,6 +649,7 @@ def test_copy(self):
649649
"2008-01-02 00:00:00.001000000",
650650
"2008-01-02 00:00:00.000001000",
651651
],
652+
strict=True,
652653
),
653654
)
654655
def test_add(self, arithmatic_offset_type, expected, dt):
@@ -657,9 +658,9 @@ def test_add(self, arithmatic_offset_type, expected, dt):
657658

658659
@pytest.mark.parametrize(
659660
"arithmatic_offset_type, expected",
660-
zip(
661-
_ARITHMETIC_DATE_OFFSET,
662-
[
661+
zip(
662+
_ARITHMETIC_DATE_OFFSET,
663+
[
663664
"2007-01-02",
664665
"2007-12-02",
665666
"2007-12-26",
@@ -670,6 +671,7 @@ def test_add(self, arithmatic_offset_type, expected, dt):
670671
"2008-01-01 23:59:59.999000000",
671672
"2008-01-01 23:59:59.999999000",
672673
],
674+
strict=True,
673675
),
674676
)
675677
def test_sub(self, arithmatic_offset_type, expected, dt):
@@ -693,6 +695,7 @@ def test_sub(self, arithmatic_offset_type, expected, dt):
693695
"2008-01-02 00:00:00.008000000",
694696
"2008-01-02 00:00:00.000009000",
695697
],
698+
strict=True,
696699
),
697700
)
698701
def test_mul_add(self, arithmatic_offset_type, n, expected, dt):
@@ -717,6 +720,7 @@ def test_mul_add(self, arithmatic_offset_type, n, expected, dt):
717720
"2008-01-01 23:59:59.992000000",
718721
"2008-01-01 23:59:59.999991000",
719722
],
723+
strict=True,
720724
),
721725
)
722726
def test_mul_sub(self, arithmatic_offset_type, n, expected, dt):

0 commit comments

Comments
 (0)