Skip to content

Commit 9b89a6e

Browse files
committed
Fixed mismatching dtypes in tests
1 parent 4d3badd commit 9b89a6e

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

pandas/tests/io/test_excel.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1445,7 +1445,8 @@ def test_to_excel_interval_no_labels(self):
14451445
_skip_if_no_xlrd()
14461446

14471447
with ensure_clean(self.ext) as path:
1448-
frame = DataFrame(np.random.randint(-10, 10, size=(20, 1)))
1448+
frame = DataFrame(np.random.randint(-10, 10, size=(20, 1)),
1449+
dtype=np.int64)
14491450
expected = frame.copy()
14501451
frame['new'] = pd.cut(frame[0], 10)
14511452
expected['new'] = pd.cut(expected[0], 10).astype(str)
@@ -1459,7 +1460,8 @@ def test_to_excel_interval_labels(self):
14591460
_skip_if_no_xlrd()
14601461

14611462
with ensure_clean(self.ext) as path:
1462-
frame = DataFrame(np.random.randint(-10, 10, size=(20, 1)))
1463+
frame = DataFrame(np.random.randint(-10, 10, size=(20, 1)),
1464+
dtype=np.int64)
14631465
expected = frame.copy()
14641466
intervals = pd.cut(frame[0], 10, labels=['A', 'B', 'C', 'D', 'E',
14651467
'F', 'G', 'H', 'I', 'J'])
@@ -1476,7 +1478,9 @@ def test_to_excel_timedelta(self):
14761478

14771479
with ensure_clean('.xls') as path:
14781480
frame = DataFrame(np.random.randint(-10, 10, size=(20, 1)),
1479-
columns=['A'])
1481+
columns=['A'],
1482+
dtype=np.int64
1483+
)
14801484
expected = frame.copy()
14811485
frame['new'] = frame['A'].apply(lambda x: timedelta(seconds=x))
14821486
expected['new'] = expected['A'].apply(

0 commit comments

Comments
 (0)