diff --git a/pandas/tests/arrays/sparse/test_constructors.py b/pandas/tests/arrays/sparse/test_constructors.py index 0bf3ab77e9eed..c6099ea48cccb 100644 --- a/pandas/tests/arrays/sparse/test_constructors.py +++ b/pandas/tests/arrays/sparse/test_constructors.py @@ -77,7 +77,10 @@ def test_constructor_object_dtype_bool_fill(self): assert arr.dtype == SparseDtype(object, False) assert arr.fill_value is False arr_expected = np.array(data, dtype=object) - it = (type(x) == type(y) and x == y for x, y in zip(arr, arr_expected)) + it = ( + type(x) == type(y) and x == y + for x, y in zip(arr, arr_expected, strict=True) + ) assert np.fromiter(it, dtype=np.bool_).all() @pytest.mark.parametrize("dtype", [SparseDtype(int, 0), int]) diff --git a/pandas/tests/arrays/test_datetimes.py b/pandas/tests/arrays/test_datetimes.py index 199e3572732a0..5a7cad77a9de0 100644 --- a/pandas/tests/arrays/test_datetimes.py +++ b/pandas/tests/arrays/test_datetimes.py @@ -144,7 +144,7 @@ def test_iter(self, dta): def test_astype_object(self, dta): result = dta.astype(object) assert all(x._creso == dta._creso for x in result) - assert all(x == y for x, y in zip(result, dta)) + assert all(x == y for x, y in zip(result, dta, strict=True)) def test_to_pydatetime(self, dta_dti): dta, dti = dta_dti