From 47947dbe4eab09a619c042745dd58f27662a4c1a Mon Sep 17 00:00:00 2001 From: Thomas A Caswell Date: Thu, 10 Aug 2017 11:40:08 -0400 Subject: [PATCH] TST: extend test and add issue reference --- pandas/tests/frame/test_api.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pandas/tests/frame/test_api.py b/pandas/tests/frame/test_api.py index dccaf2718ca683..4c7de1a10c031a 100644 --- a/pandas/tests/frame/test_api.py +++ b/pandas/tests/frame/test_api.py @@ -165,9 +165,13 @@ def test_iteritems(self): assert type(v) == Series def test_items(self): - df = DataFrame([[1, 2, 3], [4, 5, 6]], columns=['a', 'a', 'b']) - for k, v in df.items(): + # issue #17213, #13918 + cols = ['a', 'b', 'c'] + df = DataFrame([[1, 2, 3], [4, 5, 6]], columns=cols) + for c, (k, v) in zip(cols, df.items()): + assert c == k assert type(v) == Series + assert (df[k] == v).all() def test_iter(self): assert tm.equalContents(list(self.frame), self.frame.columns)