Skip to content

Commit 7692a65

Browse files
author
Martin Journois
committed
TOSQUASH: update Series tests
1 parent a2e4e23 commit 7692a65

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

pandas/tests/series/test_api.py

+7-3
Original file line numberDiff line numberDiff line change
@@ -247,15 +247,19 @@ def test_tab_completion(self):
247247
tm.makeIntIndex(10),
248248
tm.makeFloatIndex(10),
249249
Index([True, False]),
250+
Index(['a{}'.format(i) for i in range(101)]),
250251
pd.MultiIndex.from_tuples(lzip('ABCD', 'EFGH')),
251252
pd.MultiIndex.from_tuples(lzip([0, 1, 2, 3], 'EFGH')), ])
252253
def test_index_tab_completion(self, index):
253254
# dir contains string-like values of the Index.
254255
s = pd.Series(index=index)
255256
dir_s = dir(s)
256-
for x in s.index.get_level_values(0):
257-
assert (not isinstance(x, string_types) or
258-
not isidentifier(x) or x in dir_s)
257+
for i, x in enumerate(s.index.unique(level=0)):
258+
if i < 100:
259+
assert (not isinstance(x, string_types) or
260+
not isidentifier(x) or x in dir_s)
261+
else:
262+
assert x not in dir_s
259263

260264
def test_not_hashable(self):
261265
s_empty = Series()

0 commit comments

Comments
 (0)