From a50a22b9929118b5c2bd0be283c416fa8c4643c4 Mon Sep 17 00:00:00 2001 From: Zhengshou Lai Date: Thu, 16 Jul 2026 18:36:45 +0800 Subject: [PATCH] =?UTF-8?q?test:=20project=5Froot=20=E6=B5=8B=E8=AF=95?= =?UTF-8?q?=E9=9A=94=E7=A6=BB=E7=9C=9F=E5=AE=9E=20settings.json=E2=80=94?= =?UTF-8?q?=E2=80=94=E8=A1=A5=20get=5Fsetting=20patch?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/test_project_root.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tests/test_project_root.py b/tests/test_project_root.py index 590dcbe..8159dc4 100644 --- a/tests/test_project_root.py +++ b/tests/test_project_root.py @@ -82,8 +82,11 @@ class TestGetWorkspaceRoot: workspace.mkdir() (project_root / "pyproject.toml").write_text('name = "myagents"\n') - with patch.dict( - os.environ, {"MYAGENTS_PROJECT_ROOT": str(project_root)}, clear=True + with ( + patch.dict( + os.environ, {"MYAGENTS_PROJECT_ROOT": str(project_root)}, clear=True + ), + patch("myagents.settings.get_setting", return_value=""), ): result = get_workspace_root() assert result == workspace.resolve() @@ -98,6 +101,7 @@ class TestGetWorkspaceRoot: "myagents.project_root.get_project_root", return_value=tmp_path / ".myagents", ), + patch("myagents.settings.get_setting", return_value=""), patch("pathlib.Path.home", return_value=home), ): result = get_workspace_root()