Skip to content

Commit f6ddc89

Browse files
committed
Fix tests for behaviour change in python 3.7
1 parent 0aab39d commit f6ddc89

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

pandas/tests/frame/test_api.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -263,12 +263,12 @@ def test_itertuples(self, float_frame):
263263
df3 = DataFrame({"f" + str(i): [i] for i in range(1024)})
264264
# will raise SyntaxError if trying to create namedtuple
265265
tup3 = next(df3.itertuples())
266-
assert not hasattr(tup3, "_fields")
267-
assert isinstance(tup3, tuple)
266+
if PY37:
267+
assert not hasattr(tup3, "_fields")
268+
else:
269+
assert hasattr(tup3, "_fields")
268270

269-
def test_itertuples_fallback_to_regular_tuples(self):
270271
# GH 28282
271-
272272
df_254_columns = DataFrame([{f"foo_{i}": f"bar_{i}" for i in range(254)}])
273273
result_254_columns = next(df_254_columns.itertuples(index=False))
274274
assert isinstance(result_254_columns, tuple)

0 commit comments

Comments
 (0)