From 67d8173f1e71caccdd2dafb5ba4cbdbe4235563f Mon Sep 17 00:00:00 2001 From: Dominik Jain Date: Sun, 1 Mar 2026 01:19:14 +0100 Subject: [PATCH] Add test for agent instantiation, including regression test for #1107 --- test/serena/test_serena_agent.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/test/serena/test_serena_agent.py b/test/serena/test_serena_agent.py index 8d8a5193..3dbef5d8 100644 --- a/test/serena/test_serena_agent.py +++ b/test/serena/test_serena_agent.py @@ -105,6 +105,18 @@ def serena_agent(request: pytest.FixtureRequest, serena_config) -> Iterator[Sere class TestSerenaAgent: + @pytest.mark.parametrize("project", [None, str(get_repo_path(Language.PYTHON)), "non_existent_path"]) + def test_agent_instantiation(self, project: str | None): + """ + Tests agent instantiation for cases where + * no project is specified at startup + * a valid project path is specified at startup + * an invalid project path is specified at startup + All cases must not raise an exception. + """ + serena_config = SerenaConfig(gui_log_window=False, web_dashboard=False) + SerenaAgent(project=project, serena_config=serena_config) + @pytest.mark.parametrize( "serena_agent,symbol_name,expected_kind,expected_file", [