From d6349de49b647bb8b7f5d620757a919463f27f7e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Freitag?= Date: Tue, 18 Apr 2023 21:38:00 +0200 Subject: [PATCH] Call evaluate_pre() instead of evaluate() on Maybe decider e19142cb6e049e079cd4af36775715fcda47cb8c introduced evaluate_pre to perform context unrolling before to call the semi-public evaluate(). The Maybe decider was not updated at that time, but its context need to be unrolled. --- factory/declarations.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/factory/declarations.py b/factory/declarations.py index 70abe35c..951b45f3 100644 --- a/factory/declarations.py +++ b/factory/declarations.py @@ -536,7 +536,7 @@ def evaluate_post(self, instance, step, overrides): return target def evaluate_pre(self, instance, step, overrides): - choice = self.decider.evaluate(instance=instance, step=step, extra={}) + choice = self.decider.evaluate_pre(instance=instance, step=step, overrides={}) target = self.yes if choice else self.no # The value can't be POST_INSTANTIATION, checked in __init__; # evaluate it as `evaluate_pre`