Skip to content

TST: skip tests needing xlrd #3517

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
1 commit merged into from
May 3, 2013
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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