Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(220)

Unified Diff: recipe_engine/autoroll.py

Issue 2841373002: [autoroll] add tests for autoroll subcommand parsing. (Closed)
Patch Set: vendored argparse Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | recipe_engine/unittests/autoroll_test.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: recipe_engine/autoroll.py
diff --git a/recipe_engine/autoroll.py b/recipe_engine/autoroll.py
index bb65b11207d85aca2f4fd563d2a89cc0d4d47101..e1143ae1548bafdd4cd18f29042ec124a4f043d7 100644
--- a/recipe_engine/autoroll.py
+++ b/recipe_engine/autoroll.py
@@ -4,6 +4,7 @@
from __future__ import print_function
+import argparse
import copy
import json
import logging
@@ -273,7 +274,7 @@ def add_subparser(parser):
'autoroll', help=helpstr, description=helpstr)
autoroll_p.add_argument(
'--output-json',
- type=os.path.abspath,
+ type=argparse.FileType('w'),
dnj 2017/04/27 17:19:03 I think we should explicitly close this when we're
iannucci 2017/04/29 18:30:56 Done.
help='A json file to output information about the roll to.')
autoroll_p.add_argument(
'--verbose-json',
@@ -318,7 +319,6 @@ def main(_package_deps, args):
run_simulation_test(repo_root, package_spec.recipes_path, ['train'])
if args.output_json:
- with open(args.output_json, 'w') as f:
- json.dump(results, f, sort_keys=True, indent=2)
+ json.dump(results, args.output_json, sort_keys=True, indent=2)
return 0
« no previous file with comments | « no previous file | recipe_engine/unittests/autoroll_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698