Skip to content

Commit a0bed85

Browse files
changhiskhanwesm
authored andcommitted
TST: skip test if no xlwt or openpyxl
1 parent 35b7f6e commit a0bed85

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

pandas/tests/test_frame.py

+11
Original file line numberDiff line numberDiff line change
@@ -4219,6 +4219,12 @@ def _check_extension_indexlabels(self, ext):
42194219
os.remove(path)
42204220

42214221
def test_excel_roundtrip_datetime(self):
4222+
try:
4223+
import xlwt
4224+
import xlrd
4225+
except ImportError:
4226+
raise nose.SkipTest
4227+
42224228
# datetime.date, not sure what to test here exactly
42234229
path = '__tmp_excel_roundtrip_datetime__.xls'
42244230
tsf = self.tsframe.copy()
@@ -4230,6 +4236,11 @@ def test_excel_roundtrip_datetime(self):
42304236
os.remove(path)
42314237

42324238
def test_excel_roundtrip_bool(self):
4239+
try:
4240+
import openpyxl
4241+
except ImportError:
4242+
raise nose.SkipTest
4243+
42334244
#Test roundtrip np.bool8, does not seem to work for xls
42344245
path = '__tmp_excel_roundtrip_bool__.xlsx'
42354246
frame = (DataFrame(np.random.randn(10,2)) >= 0)

0 commit comments

Comments
 (0)