Skip to content

Commit

Permalink
Fix conftest
Browse files Browse the repository at this point in the history
  • Loading branch information
atuonufure committed Jul 27, 2023
1 parent 83ef932 commit af288ce
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,9 @@ def runtest(self):
if "variables" in self.test:
variables.update(self.test["variables"])

if "error" in self.test and self.test["error"]:
if "error" in self.test and self.test["error"] is True:
with pytest.raises(Exception):
evaluate(resource, expression, variables, model)
raise Exception(self.test["desc"])
else:
result = evaluate(resource, expression, variables, model)
compare(result, self.test["result"])
Expand All @@ -101,4 +101,4 @@ def compare(l1, l2):
elif len(l1) == len(l2) == 1:
e1 = l1[0]
e2 = evaluate({}, l2[0])[0]
assert e1 == e2
assert e1.asStr == str(e2)

This comment has been minimized.

Copy link
@ir4y

ir4y Jul 27, 2023

Member

it is better to update the assert like this @atuonufure

assert str(e1) == str(e2)

This comment has been minimized.

Copy link
@atuonufure

atuonufure Jul 28, 2023

Author Member

done

0 comments on commit af288ce

Please sign in to comment.