Skip to content

Commit 1533748

Browse files
committed
TST: adds comments about tests which should not warn
1 parent f56139e commit 1533748

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

pandas/tests/dtypes/test_generic.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)