@@ -149,14 +149,14 @@ def test_run_prompts_normal(caplog, tmp_path):
149
149
runner = CliRunner ()
150
150
result = runner .invoke (
151
151
main .modelgauge_cli ,
152
- ["run-csv-items" , "--sut" , "demo_yes_no" , str (in_path )],
152
+ ["run-csv-items" , "--sut" , "demo_yes_no" , "-o" , tmp_path , str (in_path )],
153
153
catch_exceptions = False ,
154
154
)
155
155
156
156
assert result .exit_code == 0
157
157
158
158
out_path = re .findall (r"\S+\.csv" , caplog .text )[0 ]
159
- with open (tmp_path / out_path , "r" ) as f :
159
+ with open (out_path , "r" ) as f :
160
160
reader = csv .DictReader (f )
161
161
162
162
rows = (next (reader ), next (reader ))
@@ -175,7 +175,7 @@ def test_run_prompts_invalid_sut(arg_name, tmp_path):
175
175
runner = CliRunner ()
176
176
result = runner .invoke (
177
177
main .modelgauge_cli ,
178
- ["run-csv-items" , arg_name , "unknown-uid" , str (in_path )],
178
+ ["run-csv-items" , arg_name , "unknown-uid" , "-o" , tmp_path , str (in_path )],
179
179
catch_exceptions = False ,
180
180
)
181
181
@@ -188,7 +188,7 @@ def test_run_prompts_multiple_invalid_suts(tmp_path):
188
188
runner = CliRunner ()
189
189
result = runner .invoke (
190
190
main .modelgauge_cli ,
191
- ["run-csv-items" , "--sut" , "unknown-uid1" , "--sut" , "unknown-uid2" , str (in_path )],
191
+ ["run-csv-items" , "--sut" , "unknown-uid1" , "--sut" , "unknown-uid2" , "-o" , tmp_path , str (in_path )],
192
192
catch_exceptions = False ,
193
193
)
194
194
@@ -203,7 +203,7 @@ def test_run_prompts_invalid_annotator(sut_uid, tmp_path):
203
203
runner = CliRunner ()
204
204
result = runner .invoke (
205
205
main .modelgauge_cli ,
206
- ["run-csv-items" , "--sut" , sut_uid , "--annotator" , "unknown-uid" , str (in_path )],
206
+ ["run-csv-items" , "--sut" , sut_uid , "--annotator" , "unknown-uid" , "-o" , tmp_path , str (in_path )],
207
207
catch_exceptions = False ,
208
208
)
209
209
@@ -225,6 +225,8 @@ def test_run_prompts_with_annotators(caplog, tmp_path):
225
225
"demo_annotator" ,
226
226
"--workers" ,
227
227
"5" ,
228
+ "-o" ,
229
+ tmp_path ,
228
230
str (in_path ),
229
231
],
230
232
catch_exceptions = False ,
@@ -233,7 +235,7 @@ def test_run_prompts_with_annotators(caplog, tmp_path):
233
235
234
236
out_path = re .findall (r"\S+\.jsonl" , caplog .text )[0 ]
235
237
output = []
236
- with jsonlines .open (tmp_path / out_path ) as reader :
238
+ with jsonlines .open (out_path ) as reader :
237
239
output .append (reader .read ())
238
240
output .append (reader .read ())
239
241
assert {
@@ -271,6 +273,8 @@ def test_run_prompts_with_options(mock_translate_text_prompt, tmp_path, extra_op
271
273
"0.5" ,
272
274
"--top-k" ,
273
275
"0" ,
276
+ "-o" ,
277
+ tmp_path ,
274
278
str (in_path ),
275
279
* extra_options ,
276
280
],
@@ -293,7 +297,7 @@ def test_run_prompts_bad_sut(tmp_path):
293
297
runner = CliRunner ()
294
298
result = runner .invoke (
295
299
main .modelgauge_cli ,
296
- ["run-csv-items" , "--sut" , "noreqs" , str (in_path )],
300
+ ["run-csv-items" , "--sut" , "noreqs" , "-o" , tmp_path , str (in_path )],
297
301
catch_exceptions = False ,
298
302
)
299
303
assert result .exit_code == 2
@@ -317,14 +321,16 @@ def test_run_annotators(caplog, tmp_path):
317
321
"run-csv-items" ,
318
322
"--annotator" ,
319
323
"demo_annotator" ,
324
+ "-o" ,
325
+ tmp_path ,
320
326
str (in_path ),
321
327
],
322
328
catch_exceptions = False ,
323
329
)
324
330
assert result .exit_code == 0
325
331
326
332
out_path = re .findall (r"\S+\.jsonl" , caplog .text )[0 ]
327
- with jsonlines .open (tmp_path / out_path ) as reader :
333
+ with jsonlines .open (out_path ) as reader :
328
334
assert reader .read () == {
329
335
"UID" : "p1" ,
330
336
"Prompt" : "Say yes" ,
@@ -356,6 +362,8 @@ def test_run_annotators_with_sut_options(tmp_path, option_name, option_val):
356
362
"demo_annotator" ,
357
363
f"--{ option_name } " ,
358
364
option_val ,
365
+ "-o" ,
366
+ tmp_path ,
359
367
str (in_path ),
360
368
],
361
369
catch_exceptions = False ,
0 commit comments