Skip to content

Commit 3d5116c

Browse files
committed
wip
1 parent 4bf94a0 commit 3d5116c

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

pandas/tests/copy_view/test_indexing.py

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -805,16 +805,14 @@ def test_set_value_copy_only_necessary_column(indexer_func, indexer, val, col):
805805
view = df[:]
806806

807807
if val == "a":
808-
with tm.assert_produces_warning(
809-
FutureWarning, match="Setting an item of incompatible dtype is deprecated"
810-
):
808+
with pytest.raises(TypeError, match="Invalid value"):
811809
indexer_func(df)[indexer] = val
810+
else:
811+
indexer_func(df)[indexer] = val
812812

813-
indexer_func(df)[indexer] = val
814-
815-
assert np.shares_memory(get_array(df, "b"), get_array(view, "b"))
816-
assert not np.shares_memory(get_array(df, "a"), get_array(view, "a"))
817-
tm.assert_frame_equal(view, df_orig)
813+
assert np.shares_memory(get_array(df, "b"), get_array(view, "b"))
814+
assert not np.shares_memory(get_array(df, "a"), get_array(view, "a"))
815+
tm.assert_frame_equal(view, df_orig)
818816

819817

820818
def test_series_midx_slice():

pandas/tests/series/methods/test_update.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,10 @@ def test_update(self):
6262
def test_update_dtypes(self, other, dtype, expected, warn):
6363
ser = Series([10, 11, 12], dtype=dtype)
6464
other = Series(other, index=[1, 3])
65-
with pytest.raises(TypeError, match="Invalid value"):
65+
if warn:
66+
with pytest.raises(TypeError, match="Invalid value"):
67+
ser.update(other)
68+
else:
6669
ser.update(other)
6770

6871
@pytest.mark.parametrize(

0 commit comments

Comments
 (0)