From 05770520afe248b7ae9da43dd3857f1647160d66 Mon Sep 17 00:00:00 2001 From: teknium1 Date: Sat, 14 Mar 2026 08:24:59 -0700 Subject: [PATCH] test(skills): isolate well-known cache in adapter tests Prevent the mocked well-known adapter tests from sharing index-cache state across runs or xdist workers. --- tests/tools/test_skills_hub.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tests/tools/test_skills_hub.py b/tests/tools/test_skills_hub.py index ba2b894d..89ed5f5e 100644 --- a/tests/tools/test_skills_hub.py +++ b/tests/tools/test_skills_hub.py @@ -345,8 +345,10 @@ class TestWellKnownSkillSource: called_url = mock_get.call_args.args[0] assert called_url == "https://example.com/.well-known/skills/index.json" + @patch("tools.skills_hub._write_index_cache") + @patch("tools.skills_hub._read_index_cache", return_value=None) @patch("tools.skills_hub.httpx.get") - def test_inspect_fetches_skill_md_from_well_known_endpoint(self, mock_get): + def test_inspect_fetches_skill_md_from_well_known_endpoint(self, mock_get, _mock_read_cache, _mock_write_cache): def fake_get(url, *args, **kwargs): if url.endswith("/index.json"): return MagicMock(status_code=200, json=lambda: { @@ -365,8 +367,10 @@ class TestWellKnownSkillSource: assert meta.source == "well-known" assert meta.extra["base_url"] == "https://example.com/.well-known/skills" + @patch("tools.skills_hub._write_index_cache") + @patch("tools.skills_hub._read_index_cache", return_value=None) @patch("tools.skills_hub.httpx.get") - def test_fetch_downloads_skill_files_from_well_known_endpoint(self, mock_get): + def test_fetch_downloads_skill_files_from_well_known_endpoint(self, mock_get, _mock_read_cache, _mock_write_cache): def fake_get(url, *args, **kwargs): if url.endswith("/index.json"): return MagicMock(status_code=200, json=lambda: {