File tree Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -49,27 +49,30 @@ def test_setattr_warnings():
4949 df = pd .DataFrame (d )
5050
5151 with catch_warnings (record = True ) as w :
52- # successfully add new column
52+ # successfully add new column
53+ # this should not raise a warning
5354 df ['three' ] = df .two + 1
5455 assert len (w ) == 0
5556 assert df .three .sum () > df .two .sum ()
5657
5758 with catch_warnings (record = True ) as w :
58- # successfully modify column in place
59+ # successfully modify column in place
60+ # this should not raise a warning
5961 df .one += 1
6062 assert len (w ) == 0
6163 assert df .one .iloc [0 ] == 2
6264
6365 with catch_warnings (record = True ) as w :
64- # successfully add an attribute to a series
66+ # successfully add an attribute to a series
67+ # this should not raise a warning
6568 df .two .not_an_index = [1 , 2 ]
6669 assert len (w ) == 0
6770
6871 with tm .assert_produces_warning (UserWarning ):
69- # warn when setting column to nonexistent name
72+ # warn when setting column to nonexistent name
7073 df .four = df .two + 2
7174 assert df .four .sum () > df .two .sum ()
72-
75+
7376 with tm .assert_produces_warning (UserWarning ):
74- # warn when column has same name as method
77+ # warn when column has same name as method
7578 df ['sum' ] = df .two
You can’t perform that action at this time.
0 commit comments