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

Unified Diff: recipe_engine/autoroll.py

Issue 2841373002: [autoroll] add tests for autoroll subcommand parsing. (Closed)
Patch Set: close file 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..f3866b4225093d93819c290c314b950d923fecb6 100644
--- a/recipe_engine/autoroll.py
+++ b/recipe_engine/autoroll.py
@@ -18,6 +18,10 @@ from . import package
from . import package_io
from .autoroll_impl.candidate_algorithm import get_roll_candidates
+from . import env
+
+import argparse # this is vendored
+
LOGGER = logging.getLogger(__name__)
@@ -273,7 +277,7 @@ def add_subparser(parser):
'autoroll', help=helpstr, description=helpstr)
autoroll_p.add_argument(
'--output-json',
- type=os.path.abspath,
+ type=argparse.FileType('w'),
help='A json file to output information about the roll to.')
autoroll_p.add_argument(
'--verbose-json',
@@ -318,7 +322,7 @@ 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)
+ with args.output_json:
+ 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