Skip to content

Commit c4aa512

Browse files
author
Wang Haoxiang
authored
STY: Add strict=True to zip() calls in pandas\tests\arrays (pandas-dev#62905)
Co-authored-by: wdyy20041223 <2795352227@qq,com>
1 parent 86a4db1 commit c4aa512

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

pandas/tests/arrays/sparse/test_constructors.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,10 @@ def test_constructor_object_dtype_bool_fill(self):
7777
assert arr.dtype == SparseDtype(object, False)
7878
assert arr.fill_value is False
7979
arr_expected = np.array(data, dtype=object)
80-
it = (type(x) == type(y) and x == y for x, y in zip(arr, arr_expected))
80+
it = (
81+
type(x) == type(y) and x == y
82+
for x, y in zip(arr, arr_expected, strict=True)
83+
)
8184
assert np.fromiter(it, dtype=np.bool_).all()
8285

8386
@pytest.mark.parametrize("dtype", [SparseDtype(int, 0), int])

pandas/tests/arrays/test_datetimes.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ def test_iter(self, dta):
144144
def test_astype_object(self, dta):
145145
result = dta.astype(object)
146146
assert all(x._creso == dta._creso for x in result)
147-
assert all(x == y for x, y in zip(result, dta))
147+
assert all(x == y for x, y in zip(result, dta, strict=True))
148148

149149
def test_to_pydatetime(self, dta_dti):
150150
dta, dti = dta_dti

0 commit comments

Comments
 (0)