From d19d35f6b39f59b0a27126ebd05f3e1b15b02026 Mon Sep 17 00:00:00 2001 From: Hongming Wang Date: Mon, 27 Apr 2026 02:04:26 -0700 Subject: [PATCH] test(skills): make watcher test fakes accept current_runtime kwarg MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The runtime-compat change in this branch added a `current_runtime` kwarg to load_skills(); the watcher passes it through. Test mocks that pre-date the kwarg signature broke with TypeError, which the watcher's reload-error try/except swallowed — the symptom was empty callback lists, not a clear failure. Switching the fakes to accept **kwargs keeps them forward-compat for future load_skills additions without another test churn. Co-Authored-By: Claude Opus 4.7 (1M context) --- workspace/tests/test_skills_watcher.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/workspace/tests/test_skills_watcher.py b/workspace/tests/test_skills_watcher.py index c587eb7b..6943871f 100644 --- a/workspace/tests/test_skills_watcher.py +++ b/workspace/tests/test_skills_watcher.py @@ -181,7 +181,7 @@ class TestReloadSkill: tools=[], ) - def fake_load_skills(config_path, skill_names): + def fake_load_skills(config_path, skill_names, **kwargs): return [fake_skill] monkeypatch.setattr(_watcher_mod, "_load_skills_impl", @@ -218,7 +218,7 @@ class TestReloadSkill: ) skills_mod = ModuleType("skill_loader.loader") - skills_mod.load_skills = lambda cp, names: [fake_skill] + skills_mod.load_skills = lambda cp, names, **_: [fake_skill] monkeypatch.setitem(sys.modules, "skill_loader.loader", skills_mod) await w._reload_skill("sk2", ["sk2/SKILL.md"]) @@ -245,7 +245,7 @@ class TestReloadSkill: tools=[], ) skills_mod = ModuleType("skill_loader.loader") - skills_mod.load_skills = lambda cp, names: [fake_skill] + skills_mod.load_skills = lambda cp, names, **_: [fake_skill] monkeypatch.setitem(sys.modules, "skill_loader.loader", skills_mod) await w._reload_skill("audited", ["audited/SKILL.md"]) @@ -317,7 +317,7 @@ class TestWatcherLifecycle: tools=[], ) skills_mod = ModuleType("skill_loader.loader") - skills_mod.load_skills = lambda cp, names: [fake_skill] + skills_mod.load_skills = lambda cp, names, **_: [fake_skill] monkeypatch.setitem(sys.modules, "skill_loader.loader", skills_mod) _watcher_mod.POLL_INTERVAL = 0.01 @@ -378,7 +378,7 @@ class TestEvictStaleModules: tools=[], ) skills_mod = ModuleType("skill_loader.loader") - skills_mod.load_skills = lambda cp, names: [fake_skill] + skills_mod.load_skills = lambda cp, names, **_: [fake_skill] monkeypatch.setitem(sys.modules, "skill_loader.loader", skills_mod) w = SkillsWatcher(str(tmp_path), ["sk"]) @@ -401,7 +401,7 @@ class TestAuditEventExceptionSuppressed: tools=[], ) skills_mod = ModuleType("skill_loader.loader") - skills_mod.load_skills = lambda cp, names: [fake_skill] + skills_mod.load_skills = lambda cp, names, **_: [fake_skill] monkeypatch.setitem(sys.modules, "skill_loader.loader", skills_mod) # Make tools.audit.log_event raise an exception @@ -429,7 +429,7 @@ class TestOnReloadCallbackException: tools=[], ) skills_mod = ModuleType("skill_loader.loader") - skills_mod.load_skills = lambda cp, names: [fake_skill] + skills_mod.load_skills = lambda cp, names, **_: [fake_skill] monkeypatch.setitem(sys.modules, "skill_loader.loader", skills_mod) def failing_callback(skill): @@ -451,7 +451,7 @@ class TestOnReloadCallbackException: tools=[], ) skills_mod = ModuleType("skill_loader.loader") - skills_mod.load_skills = lambda cp, names: [fake_skill] + skills_mod.load_skills = lambda cp, names, **_: [fake_skill] monkeypatch.setitem(sys.modules, "skill_loader.loader", skills_mod) async def failing_async_callback(skill):