@@ -391,11 +391,11 @@ def main():
391391 run_options .add_argument (
392392 '--max-retries' , metavar = 'NUM' , action = 'store' , default = 0 ,
393393 help = 'Set the maximum number of times a failed regression test '
394- 'may be retried (default: 0)'
394+ 'may be retried (default: 0)' , type = int
395395 )
396396 run_options .add_argument (
397397 '--maxfail' , metavar = 'NUM' , action = 'store' , default = sys .maxsize ,
398- help = 'Exit after first NUM failures'
398+ help = 'Exit after first NUM failures' , type = int
399399 )
400400 run_options .add_argument (
401401 '--mode' , action = 'store' , help = 'Execution mode to use'
@@ -527,8 +527,10 @@ def main():
527527 dest = 'git_timeout' ,
528528 envvar = 'RFM_GIT_TIMEOUT' ,
529529 configvar = 'general/git_timeout' ,
530+ action = 'store' ,
530531 help = ('Timeout in seconds when checking if the url is a '
531- 'valid repository.' )
532+ 'valid repository.' ),
533+ type = float
532534 )
533535 argparser .add_argument (
534536 dest = 'graylog_server' ,
@@ -568,7 +570,8 @@ def main():
568570 envvar = 'RFM_PIPELINE_TIMEOUT' ,
569571 configvar = 'general/pipeline_timeout' ,
570572 action = 'store' ,
571- help = 'Timeout for advancing the pipeline'
573+ help = 'Timeout for advancing the pipeline' ,
574+ type = float
572575 )
573576 argparser .add_argument (
574577 dest = 'remote_detect' ,
@@ -1172,26 +1175,14 @@ def module_unuse(*paths):
11721175 parsed_job_options .append (f'--{ optstr } { valstr } ' )
11731176
11741177 exec_policy .sched_options = parsed_job_options
1175- try :
1176- max_retries = int (options .max_retries )
1177- except ValueError :
1178- raise errors .ConfigError (
1179- f'--max-retries is not a valid integer: { max_retries } '
1180- ) from None
1181-
1182- try :
1183- max_failures = int (options .maxfail )
1184- if max_failures < 0 :
1185- raise errors .ConfigError (
1186- f'--maxfail should be a non-negative integer: '
1187- f'{ options .maxfail !r} '
1188- )
1189- except ValueError :
1178+ if options .maxfail < 0 :
11901179 raise errors .ConfigError (
1191- f'--maxfail is not a valid integer: { options .maxfail !r} '
1192- ) from None
1180+ f'--maxfail should be a non-negative integer: '
1181+ f'{ options .maxfail !r} '
1182+ )
11931183
1194- runner = Runner (exec_policy , printer , max_retries , max_failures )
1184+ runner = Runner (exec_policy , printer , options .max_retries ,
1185+ options .maxfail )
11951186 try :
11961187 time_start = time .time ()
11971188 session_info ['time_start' ] = time .strftime (
0 commit comments