@@ -49,35 +49,19 @@ def test_loc_setitem_multiindex_columns(self, consolidate):
49
49
def test_37477 ():
50
50
# fixed by GH#45121
51
51
orig = DataFrame ({"A" : [1 , 2 , 3 ], "B" : [3 , 4 , 5 ]})
52
- expected = DataFrame ({"A" : [1 , 2 , 3 ], "B" : [3 , 1.2 , 5 ]})
53
52
54
53
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" ):
58
55
df .at [1 , "B" ] = 1.2
59
- tm .assert_frame_equal (df , expected )
60
56
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" ):
65
58
df .loc [1 , "B" ] = 1.2
66
- tm .assert_frame_equal (df , expected )
67
59
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" ):
72
61
df .iat [1 , 1 ] = 1.2
73
- tm .assert_frame_equal (df , expected )
74
62
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" ):
79
64
df .iloc [1 , 1 ] = 1.2
80
- tm .assert_frame_equal (df , expected )
81
65
82
66
83
67
def test_6942 (indexer_al ):
0 commit comments