From 131a9130176765fb1d7c4e8f053d6128270f5c98 Mon Sep 17 00:00:00 2001 From: ChuckBuilds Date: Tue, 14 Jul 2026 08:25:27 -0400 Subject: [PATCH] fix(testing): clear get_cached_data_with_strategy_calls in MockCacheManager.reset() reset() cleared get_calls/set_calls/delete_calls but not the newer get_cached_data_with_strategy_calls tracker, so a reused mock (e.g. across test cases sharing a fixture) retained stale strategy-call records after reset(). Co-Authored-By: Claude Sonnet 5 Claude-Session: https://claude.ai/code/session_01KEZK1P1Q1fu5pcuVrkrCFZ --- src/plugin_system/testing/mocks.py | 1 + test/test_testing_mocks.py | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/src/plugin_system/testing/mocks.py b/src/plugin_system/testing/mocks.py index cbe36b31..46104c68 100644 --- a/src/plugin_system/testing/mocks.py +++ b/src/plugin_system/testing/mocks.py @@ -137,6 +137,7 @@ class MockCacheManager: self.get_calls = [] self.set_calls = [] self.delete_calls = [] + self.get_cached_data_with_strategy_calls = [] class MockConfigManager: diff --git a/test/test_testing_mocks.py b/test/test_testing_mocks.py index 4505eeec..f8ed6516 100644 --- a/test/test_testing_mocks.py +++ b/test/test_testing_mocks.py @@ -37,3 +37,9 @@ class TestMockCacheManagerStrategyMethod: cm = MockCacheManager() cm.save_cache("standings_nfl", {"teams": ["KC", "BUF"]}) assert cm.get_cached_data_with_strategy("standings_nfl") == {"teams": ["KC", "BUF"]} + + def test_reset_clears_strategy_call_tracking(self): + cm = MockCacheManager() + cm.get_cached_data_with_strategy("k", "sports_live") + cm.reset() + assert cm.get_cached_data_with_strategy_calls == []