Skip to content

Commit 99270dd

Browse files
committed
Improve test coverage for invalid formula handling
1 parent 18e314e commit 99270dd

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

tests/samples/invalid_formula.xls

42 KB
Binary file not shown.

tests/test_formulas.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,3 +79,12 @@ def test_if(self):
7979

8080
def test_choose(self):
8181
self.assertEqual(self.get_value(1, 6), "'C'")
82+
83+
def test_evaluate_name_formula_with_invalid_operand(self):
84+
book = xlrd.open_workbook(from_sample('invalid_formula.xls'))
85+
sheet = book.sheet_by_index(0)
86+
cell = sheet.cell(0, 0)
87+
88+
self.assertEqual(cell.ctype, xlrd.XL_CELL_ERROR)
89+
self.assertIn(cell.value, xlrd.error_text_from_code)
90+

0 commit comments

Comments
 (0)