Skip to content

Commit

Permalink
Adjust to clean test base
Browse files Browse the repository at this point in the history
  • Loading branch information
guillett committed Feb 6, 2024
1 parent 0c13839 commit ab478d6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions openfisca_core/simulations/simulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 ----- #

Expand Down
2 changes: 1 addition & 1 deletion tests/core/test_tracers.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
TracingParameterNodeAtInstant,
)


from .parameters_fancy_indexing.test_fancy_indexing import parameters


Expand All @@ -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):
Expand Down

0 comments on commit ab478d6

Please sign in to comment.