Skip to content

Commit

Permalink
Merge pull request #134 from igheorghita/order-of-evaluation-fix
Browse files Browse the repository at this point in the history
fix order of evaluation test
  • Loading branch information
stephenrauch committed Oct 25, 2021
2 parents 3f586c3 + db6b04f commit 6ce2bc2
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tests/test_excelcompiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
from ruamel.yaml import YAML

from pycel.excelcompiler import _Cell, _CellRange, ExcelCompiler, Mismatch
from pycel.excelformula import FormulaEvalError, FormulaParserError, UnknownFunction
from pycel.excelformula import FormulaParserError, UnknownFunction
from pycel.excelutil import (
AddressCell,
AddressRange,
Expand Down Expand Up @@ -1117,8 +1117,10 @@ def test_evaluate_after_range_eval_error():
ws = wb.active
ws['A1'], ws['B1'], ws['C1'] = 0, 1, 0
ws['A2'] = '=UNKNOWN(A1:C1,0,FALSE,1,TRUE)'
ws.formula_attributes['A2'] = {'t': 'array', 'ref': "A2:C2"}
ws['A3'] = 'hello'
ws['A4'] = '=UNKNOWN(A1:C1,1,FALSE,0,TRUE)'
ws.formula_attributes['A4'] = {'t': 'array', 'ref': "A4:C4"}
ws['A5'] = '=AND(A2,A4)'

excel_compiler = ExcelCompiler(excel=wb)
Expand All @@ -1127,6 +1129,6 @@ def test_evaluate_after_range_eval_error():
assert excel_compiler.evaluate('A3') == 'hello'

excel_compiler = ExcelCompiler(excel=wb)
with pytest.raises(FormulaEvalError):
with pytest.raises(UnknownFunction):
excel_compiler.evaluate('A5')
assert excel_compiler.evaluate('A3') == 'hello'

0 comments on commit 6ce2bc2

Please sign in to comment.