Skip to content

Commit

Permalink
Merge pull request #3517 from lodagro/test_excel
Browse files Browse the repository at this point in the history
TST: skip tests needing xlrd
  • Loading branch information
y-p committed May 3, 2013
2 parents c03f0ca + ac88929 commit ee4a740
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions pandas/io/tests/test_excel.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@
def _skip_if_no_xlrd():
try:
import xlrd
ver = tuple(map(int, xlrd.__VERSION__.split(".")[:2]))
if ver < (0, 9):
raise nose.SkipTest('xlrd not installed, skipping')
except ImportError:
raise nose.SkipTest('xlrd not installed, skipping')

Expand Down Expand Up @@ -215,6 +218,7 @@ def test_excel_read_buffer(self):
df = xl.parse('Sheet1', index_col=0, parse_dates=True)

def test_xlsx_table(self):
_skip_if_no_xlrd()
_skip_if_no_openpyxl()

pth = os.path.join(self.dirpath, 'test.xlsx')
Expand Down Expand Up @@ -294,6 +298,7 @@ def test_excel_roundtrip_xls_mixed(self):

def test_excel_roundtrip_xlsx_mixed(self):
_skip_if_no_openpyxl()
_skip_if_no_xlrd()

self._check_extension_mixed('xlsx')

Expand All @@ -314,6 +319,7 @@ def test_excel_roundtrip_xls_tsframe(self):

def test_excel_roundtrip_xlsx_tsframe(self):
_skip_if_no_openpyxl()
_skip_if_no_xlrd()
self._check_extension_tsframe('xlsx')

def _check_extension_tsframe(self, ext):
Expand Down Expand Up @@ -555,6 +561,7 @@ def test_to_excel_multiindex(self):
self._check_excel_multiindex('xls')

def test_to_excel_multiindex_xlsx(self):
_skip_if_no_xlrd()
_skip_if_no_openpyxl()
self._check_excel_multiindex('xlsx')

Expand Down Expand Up @@ -587,6 +594,7 @@ def test_to_excel_multiindex_dates(self):

def test_to_excel_multiindex_xlsx_dates(self):
_skip_if_no_openpyxl()
_skip_if_no_xlrd()
self._check_excel_multiindex_dates('xlsx')

def _check_excel_multiindex_dates(self, ext):
Expand Down

0 comments on commit ee4a740

Please sign in to comment.