From 61d7639129e1db8416226fc3a5b41c83299489ee Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 1 Mar 2026 18:38:07 +0000 Subject: [PATCH] refactor(test): simplify test patches per code review feedback Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com> --- tests/test_release_names.py | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/tests/test_release_names.py b/tests/test_release_names.py index 04cb3a0f..2c67c51d 100644 --- a/tests/test_release_names.py +++ b/tests/test_release_names.py @@ -21,23 +21,17 @@ class TestReleaseNameProperty: release_file = tmp_path / "release_names.json" release_file.write_text(json.dumps(release_data)) + from app.config import Settings + + s = Settings.__new__(Settings) with ( - patch("app.config.Settings.version", new_callable=lambda: property(lambda self: "0.5.3")), + patch.object(type(s), "version", new_callable=lambda: property(lambda self: "0.5.3")), + patch("app.config.os.path.dirname"), patch("app.config.os.path.join", return_value=str(release_file)), patch("app.config.os.path.exists", return_value=True), ): - from app.config import Settings - - s = Settings.__new__(Settings) - # Directly call the property with mocked file path - with ( - patch.object(type(s), "version", new_callable=lambda: property(lambda self: "0.5.3")), - patch("app.config.os.path.dirname"), - patch("app.config.os.path.join", return_value=str(release_file)), - patch("app.config.os.path.exists", return_value=True), - ): - result = s.release_name - assert result == "Foundation" + result = s.release_name + assert result == "Foundation" def test_release_name_returns_codename_for_exact_match(self, tmp_path): """Test release_name returns codename for exact version match."""