@@ -90,10 +90,10 @@ def test_parse_cols_int(self):
90
90
_skip_if_no_openpyxl ()
91
91
_skip_if_no_xlrd ()
92
92
93
- suffix = ['' , 'x ' ]
93
+ suffix = ['xls ' , 'xlsx' , 'xlsm ' ]
94
94
95
95
for s in suffix :
96
- pth = os .path .join (self .dirpath , 'test.xls %s' % s )
96
+ pth = os .path .join (self .dirpath , 'test.%s' % s )
97
97
xls = ExcelFile (pth )
98
98
df = xls .parse ('Sheet1' , index_col = 0 , parse_dates = True ,
99
99
parse_cols = 3 )
@@ -109,10 +109,10 @@ def test_parse_cols_list(self):
109
109
_skip_if_no_openpyxl ()
110
110
_skip_if_no_xlrd ()
111
111
112
- suffix = ['' , 'x ' ]
112
+ suffix = ['xls ' , 'xlsx' , 'xlsm ' ]
113
113
114
114
for s in suffix :
115
- pth = os .path .join (self .dirpath , 'test.xls %s' % s )
115
+ pth = os .path .join (self .dirpath , 'test.%s' % s )
116
116
xls = ExcelFile (pth )
117
117
df = xls .parse ('Sheet1' , index_col = 0 , parse_dates = True ,
118
118
parse_cols = [0 , 2 , 3 ])
@@ -129,11 +129,11 @@ def test_parse_cols_str(self):
129
129
_skip_if_no_openpyxl ()
130
130
_skip_if_no_xlrd ()
131
131
132
- suffix = ['' , 'x ' ]
132
+ suffix = ['xls ' , 'xlsx' , 'xlsm ' ]
133
133
134
134
for s in suffix :
135
135
136
- pth = os .path .join (self .dirpath , 'test.xls %s' % s )
136
+ pth = os .path .join (self .dirpath , 'test.%s' % s )
137
137
xls = ExcelFile (pth )
138
138
139
139
df = xls .parse ('Sheet1' , index_col = 0 , parse_dates = True ,
@@ -677,26 +677,26 @@ def test_excel_date_datetime_format(self):
677
677
with ensure_clean (self .ext ) as filename1 :
678
678
with ensure_clean (self .ext ) as filename2 :
679
679
writer1 = ExcelWriter (filename1 )
680
- writer2 = ExcelWriter (filename2 ,
680
+ writer2 = ExcelWriter (filename2 ,
681
681
date_format = 'DD.MM.YYYY' ,
682
682
datetime_format = 'DD.MM.YYYY HH-MM-SS' )
683
683
684
684
df .to_excel (writer1 , 'test1' )
685
685
df .to_excel (writer2 , 'test1' )
686
-
686
+
687
687
writer1 .close ()
688
688
writer2 .close ()
689
689
690
690
reader1 = ExcelFile (filename1 )
691
691
reader2 = ExcelFile (filename2 )
692
-
692
+
693
693
rs1 = reader1 .parse ('test1' , index_col = None )
694
694
rs2 = reader2 .parse ('test1' , index_col = None )
695
-
695
+
696
696
tm .assert_frame_equal (rs1 , rs2 )
697
697
698
698
# since the reader returns a datetime object for dates, we need
699
- # to use df_expected to check the result
699
+ # to use df_expected to check the result
700
700
tm .assert_frame_equal (rs2 , df_expected )
701
701
702
702
def test_to_excel_periodindex (self ):
0 commit comments