@@ -146,17 +146,11 @@ class ReadingTestsBase(SharedItems):
146
146
#
147
147
# Base class for test cases to run with different Excel readers.
148
148
# To add a reader test, define the following:
149
- # 1. A check_skip function that skips your tests if your reader isn't
150
- # installed.
151
- # 2. Add a property ext, which is the file extension that your reader
149
+ # 1. Add a property ext, which is the file extension that your reader
152
150
# reades from. (needs to start with '.' so it's a valid path)
153
- # 3 . Add a property engine_name, which is the name of the reader class.
151
+ # 2 . Add a property engine_name, which is the name of the reader class.
154
152
# For the reader this is not used for anything at the moment.
155
153
156
- def setup_method (self , method ):
157
- self .check_skip ()
158
- super (ReadingTestsBase , self ).setup_method (method )
159
-
160
154
def test_usecols_int (self ):
161
155
162
156
dfref = self .get_csv_refdf ('test1' )
@@ -567,6 +561,7 @@ def test_sheet_name_both_raises(self):
567
561
self .get_exceldf ('test1' , sheetname = 'Sheet1' , sheet_name = 'Sheet1' )
568
562
569
563
564
+ @td .skip_if_no ('xlrd' , '0.9' )
570
565
class XlrdTests (ReadingTestsBase ):
571
566
"""
572
567
This is the base class for the xlrd tests, and 3 different file formats
@@ -589,7 +584,6 @@ def test_excel_read_buffer(self):
589
584
def test_read_xlrd_Book (self ):
590
585
_skip_if_no_xlwt ()
591
586
592
- import xlrd
593
587
df = self .frame
594
588
with ensure_clean ('.xls' ) as pth :
595
589
df .to_excel (pth , "SheetA" )
@@ -713,9 +707,9 @@ def tdf(sheetname):
713
707
tm .assert_frame_equal (dfs [s ], dfs_returned [s ])
714
708
715
709
def test_reader_seconds (self ):
716
- # Test reading times with and without milliseconds. GH5945.
717
710
import xlrd
718
711
712
+ # Test reading times with and without milliseconds. GH5945.
719
713
if LooseVersion (xlrd .__VERSION__ ) >= LooseVersion ("0.9.3" ):
720
714
# Xlrd >= 0.9.3 can handle Excel milliseconds.
721
715
expected = DataFrame .from_dict ({"Time" : [time (1 , 2 , 3 ),
@@ -1061,19 +1055,16 @@ def test_read_excel_squeeze(self):
1061
1055
class TestXlsReaderTests (XlrdTests ):
1062
1056
ext = '.xls'
1063
1057
engine_name = 'xlrd'
1064
- check_skip = staticmethod (_skip_if_no_xlrd )
1065
1058
1066
1059
1067
1060
class TestXlsxReaderTests (XlrdTests ):
1068
1061
ext = '.xlsx'
1069
1062
engine_name = 'xlrd'
1070
- check_skip = staticmethod (_skip_if_no_xlrd )
1071
1063
1072
1064
1073
1065
class TestXlsmReaderTests (XlrdTests ):
1074
1066
ext = '.xlsm'
1075
1067
engine_name = 'xlrd'
1076
- check_skip = staticmethod (_skip_if_no_xlrd )
1077
1068
1078
1069
1079
1070
class ExcelWriterBase (SharedItems ):
0 commit comments