Fixed EvalEvaluator when there is nothing to evaluate

This commit is contained in:
2019-12-27 14:43:36 +01:00
parent 21da87393f
commit 81b2355633
5 changed files with 97 additions and 15 deletions
+22
View File
@@ -162,6 +162,28 @@ class EvaluatorAllReduceFooBar(EvaluatorAllWithPriority):
return ret
class EvaluatorAllSuppressFooEntry(EvaluatorAllWithPriority):
def __init__(self):
super().__init__("suppress", 100)
def matches(self, context, return_values):
super().matches(context, return_values)
return True
def eval(self, context, return_values):
super().eval(context, return_values)
foo = None
for ret in return_values:
if ret.body.name == "foo":
foo = ret
if foo:
return context.sheerka.ret(self.name, False, Concept("does not matter"), parents=[foo])
else:
return None
def test_that_return_values_is_unchanged_when_no_evaluator():
sheerka = get_sheerka()
sheerka.evaluators = []