Fixed EvalEvaluator when there is nothing to evaluate
This commit is contained in:
@@ -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 = []
|
||||
|
||||
Reference in New Issue
Block a user