Skip to content

Commit df0aa86

Browse files
committed
wip
1 parent 570ab12 commit df0aa86

File tree

1 file changed

+4
-20
lines changed

1 file changed

+4
-20
lines changed

pandas/tests/frame/indexing/test_coercion.py

Lines changed: 4 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -49,35 +49,19 @@ def test_loc_setitem_multiindex_columns(self, consolidate):
4949
def test_37477():
5050
# fixed by GH#45121
5151
orig = DataFrame({"A": [1, 2, 3], "B": [3, 4, 5]})
52-
expected = DataFrame({"A": [1, 2, 3], "B": [3, 1.2, 5]})
5352

5453
df = orig.copy()
55-
with tm.assert_produces_warning(
56-
FutureWarning, match="Setting an item of incompatible dtype"
57-
):
54+
with pytest.raises(TypeError, match="Invalid value"):
5855
df.at[1, "B"] = 1.2
59-
tm.assert_frame_equal(df, expected)
6056

61-
df = orig.copy()
62-
with tm.assert_produces_warning(
63-
FutureWarning, match="Setting an item of incompatible dtype"
64-
):
57+
with pytest.raises(TypeError, match="Invalid value"):
6558
df.loc[1, "B"] = 1.2
66-
tm.assert_frame_equal(df, expected)
6759

68-
df = orig.copy()
69-
with tm.assert_produces_warning(
70-
FutureWarning, match="Setting an item of incompatible dtype"
71-
):
60+
with pytest.raises(TypeError, match="Invalid value"):
7261
df.iat[1, 1] = 1.2
73-
tm.assert_frame_equal(df, expected)
7462

75-
df = orig.copy()
76-
with tm.assert_produces_warning(
77-
FutureWarning, match="Setting an item of incompatible dtype"
78-
):
63+
with pytest.raises(TypeError, match="Invalid value"):
7964
df.iloc[1, 1] = 1.2
80-
tm.assert_frame_equal(df, expected)
8165

8266

8367
def test_6942(indexer_al):

0 commit comments

Comments
 (0)