@@ -382,6 +382,9 @@ def parse_args(args):
382
382
parser .add_argument ('tests' , nargs = '*' )
383
383
parser .add_argument ('--failfast' , action = 'store_const' , const = True , default = False )
384
384
parser .add_argument ('--start-at' , metavar = 'NAME' , help = 'Skip all tests up until <NAME>' )
385
+ parser .add_argument ('--continue' , dest = '_continue' , action = 'store_true' ,
386
+ help = 'Resume from the last run test.'
387
+ 'Useful when combined with --failfast' )
385
388
parser .add_argument ('--force64' , action = 'store_const' , const = True , default = None )
386
389
parser .add_argument ('--crossplatform-only' , action = 'store_true' )
387
390
return parser .parse_args ()
@@ -465,6 +468,11 @@ def prepend_default(arg):
465
468
tests = tests_with_expanded_wildcards (tests , all_tests )
466
469
tests = skip_requested_tests (tests , modules )
467
470
tests = args_for_random_tests (tests , modules )
471
+
472
+ if not options .start_at and options ._continue :
473
+ if os .path .exists (common .LAST_TEST ):
474
+ options .start_at = utils .read_file (common .LAST_TEST ).strip ()
475
+
468
476
suites , unmatched_tests = load_test_suites (tests , modules , options .start_at )
469
477
if unmatched_tests :
470
478
print ('ERROR: could not find the following tests: ' + ' ' .join (unmatched_tests ))
0 commit comments