Index: recipe_engine/test.py |
diff --git a/recipe_engine/test.py b/recipe_engine/test.py |
index 4636733073aa4e741ef22d3a748f8944f28a6525..1568035c7d027404be528757185cdd6c2d4659ae 100644 |
--- a/recipe_engine/test.py |
+++ b/recipe_engine/test.py |
@@ -732,10 +732,29 @@ def parse_args(args): |
'the globs have the form of ' |
'`<recipe_name_glob>[.<test_name_glob>]`. If `.<test_name_glob>` ' |
'is omitted, it is implied to be `.*`, i.e. all tests.)') |
+ # TODO(phajdan.jr): remove --train the switch in favor of train subcommand. |
run_p.add_argument( |
'--train', action='store_true', |
help='re-generate recipe expectations') |
iannucci
2017/03/31 17:50:09
let's add a deprecation text in the help too.
Paweł Hajdan Jr.
2017/03/31 17:51:44
Done.
|
+ train_p = subp.add_parser('train', description='Re-train recipe expectations') |
+ train_p.set_defaults(func=lambda opts: run_run( |
+ opts.filter, jobs=opts.jobs, json_file=opts.json, train=True)) |
+ train_p.add_argument( |
+ '--jobs', metavar='N', type=int, |
+ default=multiprocessing.cpu_count(), |
+ help='run N jobs in parallel (default %(default)s)') |
+ train_p.add_argument( |
+ '--json', metavar='FILE', type=argparse.FileType('w'), |
+ help='path to JSON output file') |
+ train_p.add_argument( |
+ '--filter', action='append', |
+ help='glob filter for the tests to run; ' |
+ 'can be specified multiple times; ' |
+ 'the globs have the form of ' |
+ '`<recipe_name_glob>[.<test_name_glob>]`. If `.<test_name_glob>` ' |
+ 'is omitted, it is implied to be `.*`, i.e. all tests.)') |
+ |
debug_p = subp.add_parser( |
'debug', description='Run the tests under debugger (pdb)') |
debug_p.set_defaults(func=lambda opts: run_run( |