From ab478d6746d3b1ff4a0feef24214cd99799ca5fc Mon Sep 17 00:00:00 2001 From: Thomas Guillet Date: Tue, 6 Feb 2024 16:01:21 +0100 Subject: [PATCH] Adjust to clean test base --- openfisca_core/simulations/simulation.py | 4 ++-- tests/core/test_tracers.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/openfisca_core/simulations/simulation.py b/openfisca_core/simulations/simulation.py index 2966b9b16..8815e3222 100644 --- a/openfisca_core/simulations/simulation.py +++ b/openfisca_core/simulations/simulation.py @@ -418,10 +418,10 @@ def invalidate_cache_entry(self, variable: str, period): def invalidate_spiral_variables(self, variable: str): invalidate_entries = False for frame in self.tracer.stack: + if not invalidate_entries and frame["name"] == variable: + invalidate_entries = True if invalidate_entries: self.invalidate_cache_entry(str(frame["name"]), frame["period"]) - elif frame["name"] == variable: - invalidate_entries = True # ----- Methods to access stored values ----- # diff --git a/tests/core/test_tracers.py b/tests/core/test_tracers.py index b1302eb05..76343d375 100644 --- a/tests/core/test_tracers.py +++ b/tests/core/test_tracers.py @@ -18,7 +18,6 @@ TracingParameterNodeAtInstant, ) - from .parameters_fancy_indexing.test_fancy_indexing import parameters @@ -30,6 +29,7 @@ class StubSimulation(Simulation): def __init__(self): self.exception = None self.max_spiral_loops = 1 + self.max_spiral_lookback_months = 0 self.invalidated_cache_items = [] def _calculate(self, variable, period):