Skip to content

Commit 35c2377

Browse files
Backport PR #58389 on branch 2.2.x (CI: Fix npdev failures) (#58408)
Backport PR #58389: CI: Fix npdev failures Co-authored-by: Matthew Roeschke <[email protected]>
1 parent 294b215 commit 35c2377

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

pandas/tests/arrays/test_datetimelike.py

+6-2
Original file line numberDiff line numberDiff line change
@@ -659,7 +659,9 @@ def test_array_interface(self, datetime_index):
659659
assert result is expected
660660
tm.assert_numpy_array_equal(result, expected)
661661
result = np.array(arr, dtype="datetime64[ns]")
662-
assert result is not expected
662+
if not np_version_gt2:
663+
# TODO: GH 57739
664+
assert result is not expected
663665
tm.assert_numpy_array_equal(result, expected)
664666

665667
# to object dtype
@@ -974,7 +976,9 @@ def test_array_interface(self, timedelta_index):
974976
assert result is expected
975977
tm.assert_numpy_array_equal(result, expected)
976978
result = np.array(arr, dtype="timedelta64[ns]")
977-
assert result is not expected
979+
if not np_version_gt2:
980+
# TODO: GH 57739
981+
assert result is not expected
978982
tm.assert_numpy_array_equal(result, expected)
979983

980984
# to object dtype

pandas/tests/extension/base/missing.py

+2
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,9 @@ def test_isna_returns_copy(self, data_missing, na_func):
2727
expected = result.copy()
2828
mask = getattr(result, na_func)()
2929
if isinstance(mask.dtype, pd.SparseDtype):
30+
# TODO: GH 57739
3031
mask = np.array(mask)
32+
mask.flags.writeable = True
3133

3234
mask[:] = True
3335
tm.assert_series_equal(result, expected)

pandas/tests/indexes/test_base.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,8 @@ def test_constructor_casting(self, index):
7171
tm.assert_contains_all(arr, new_index)
7272
tm.assert_index_equal(index, new_index)
7373

74-
@pytest.mark.parametrize("index", ["string"], indirect=True)
75-
def test_constructor_copy(self, index, using_infer_string):
74+
def test_constructor_copy(self, using_infer_string):
75+
index = Index(list("abc"), name="name")
7676
arr = np.array(index)
7777
new_index = Index(arr, copy=True, name="name")
7878
assert isinstance(new_index, Index)

0 commit comments

Comments
 (0)