Skip to content

Commit 61f3679

Browse files
author
Martin Journois
committed
TOSQUASH: update DataFrame tests
1 parent 71c31e2 commit 61f3679

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

pandas/tests/frame/test_api.py

+6-2
Original file line numberDiff line numberDiff line change
@@ -131,15 +131,19 @@ def test_column_contains_typeerror(self):
131131
def test_tab_completion(self):
132132
# DataFrame whose columns are identifiers shall have them in __dir__.
133133
df = pd.DataFrame([list('abcd'), list('efgh')], columns=list('ABCD'))
134-
assert 'A' in dir(df)
134+
for key in list('ABCD'):
135+
assert key in dir(df)
135136
assert isinstance(df.__getitem__('A'), pd.Series)
136137

137138
# DataFrame whose first-level columns are identifiers shall have
138139
# them in __dir__.
139140
df = pd.DataFrame(
140141
[list('abcd'), list('efgh')],
141142
columns=pd.MultiIndex.from_tuples(list(zip('ABCD', 'EFGH'))))
142-
assert 'A' in dir(df)
143+
for key in list('ABCD'):
144+
assert key in dir(df)
145+
for key in list('EFGH'):
146+
assert key not in dir(df)
143147
assert isinstance(df.__getitem__('A'), pd.DataFrame)
144148

145149
def test_not_hashable(self):

0 commit comments

Comments
 (0)