File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -629,6 +629,7 @@ async def _try_server(url):
629629 return "127.0.0.1" in url or "localhost" in url
630630
631631 mock_process = AsyncMock ()
632+ mock_process .terminate = MagicMock ()
632633 with (
633634 patch ("vectorcode.common.start_server" , return_value = mock_process ),
634635 patch ("vectorcode.common.try_server" , side_effect = _try_server ),
@@ -639,3 +640,4 @@ async def _try_server(url):
639640 assert len (manager .get_processes ()) == 1
640641 await manager .kill_servers ()
641642 mock_process .terminate .assert_called_once ()
643+ mock_process .wait .assert_awaited ()
Original file line number Diff line number Diff line change 44
55from vectorcode import __version__
66from vectorcode .cli_utils import CliAction
7- from vectorcode .main import async_main , main
7+ from vectorcode .main import async_main
88
99
1010@pytest .mark .asyncio
@@ -317,12 +317,3 @@ async def test_async_main_exception_handling(monkeypatch):
317317 with patch ("vectorcode.main.logger" ) as mock_logger :
318318 assert await async_main () == 1
319319 mock_logger .error .assert_called_once ()
320-
321-
322- def test_main (monkeypatch ):
323- mock_async_main = AsyncMock (return_value = 0 )
324- monkeypatch .setattr ("vectorcode.main.async_main" , mock_async_main )
325- monkeypatch .setattr ("asyncio.run" , MagicMock (return_value = 0 ))
326-
327- result = main ()
328- assert result == 0
You can’t perform that action at this time.
0 commit comments