@@ -59,14 +59,15 @@ def test_llm_command_with_c_flag_and_fenced_sql(mock_run_cmd, mock_llm, executor
5959
6060 test_text = r"\llm -c 'Rewrite the SQL without CTE'"
6161
62- result , sql = handle_llm (test_text , executor )
62+ result , sql , duration = handle_llm (test_text , executor )
6363
6464 # We expect the function to return (result, sql), but result might be "" if verbose is not set
6565 # By default, `verbose` is false unless text has something like \llm --verbose?
6666 # The function code: return result if verbose else "", sql
6767 # Our test_text doesn't set verbose => we expect "" for the returned context.
6868 assert result == ""
6969 assert sql == "SELECT * FROM table;"
70+ assert isinstance (duration , float )
7071
7172
7273@patch ("litecli.packages.special.llm.llm" )
@@ -133,7 +134,7 @@ def test_llm_command_with_prompt(mock_sql_using_llm, mock_ensure_template, mock_
133134 mock_sql_using_llm .return_value = ("context from LLM" , "SELECT 1;" )
134135
135136 test_text = r"\llm prompt 'Magic happening here?'"
136- context , sql = handle_llm (test_text , executor )
137+ context , sql , duration = handle_llm (test_text , executor )
137138
138139 # ensure_litecli_template should be called
139140 mock_ensure_template .assert_called_once ()
@@ -143,6 +144,7 @@ def test_llm_command_with_prompt(mock_sql_using_llm, mock_ensure_template, mock_
143144 mock_sql_using_llm .assert_called ()
144145 assert context == ""
145146 assert sql == "SELECT 1;"
147+ assert isinstance (duration , float )
146148
147149
148150@patch ("litecli.packages.special.llm.llm" )
@@ -155,12 +157,13 @@ def test_llm_command_question_with_context(mock_sql_using_llm, mock_ensure_templ
155157 mock_sql_using_llm .return_value = ("You have context!" , "SELECT 2;" )
156158
157159 test_text = r"\llm 'Top 10 downloads by size.'"
158- context , sql = handle_llm (test_text , executor )
160+ context , sql , duration = handle_llm (test_text , executor )
159161
160162 mock_ensure_template .assert_called_once ()
161163 mock_sql_using_llm .assert_called ()
162164 assert context == ""
163165 assert sql == "SELECT 2;"
166+ assert isinstance (duration , float )
164167
165168
166169@patch ("litecli.packages.special.llm.llm" )
@@ -173,7 +176,9 @@ def test_llm_command_question_verbose(mock_sql_using_llm, mock_ensure_template,
173176 mock_sql_using_llm .return_value = ("Verbose context, oh yeah!" , "SELECT 42;" )
174177
175178 test_text = r"\llm+ 'Top 10 downloads by size.'"
176- context , sql = handle_llm (test_text , executor )
179+ context , sql , duration = handle_llm (test_text , executor )
177180
178181 assert context == "Verbose context, oh yeah!"
179182 assert sql == "SELECT 42;"
183+
184+ assert isinstance (duration , float )
0 commit comments