| Index: recipe_engine/test.py
|
| diff --git a/recipe_engine/test.py b/recipe_engine/test.py
|
| index 2924b206e684ff3b3738f9885ab45175148460fa..d3704db5b78d6b801f08d5b9b3c02c7f34239c05 100644
|
| --- a/recipe_engine/test.py
|
| +++ b/recipe_engine/test.py
|
| @@ -207,9 +207,16 @@ def run_test(test_description, debug=False, train=False):
|
| """Runs a test. Returns TestResults object."""
|
| expected = None
|
| if os.path.exists(test_description.expectation_path):
|
| - with open(test_description.expectation_path) as f:
|
| - # TODO(phajdan.jr): why do we need to re-encode golden data files?
|
| - expected = re_encode(json.load(f))
|
| + try:
|
| + with open(test_description.expectation_path) as f:
|
| + # TODO(phajdan.jr): why do we need to re-encode golden data files?
|
| + expected = re_encode(json.load(f))
|
| + except Exception:
|
| + if train:
|
| + # Ignore errors when training; we're going to overwrite the file anyway.
|
| + expected = None
|
| + else:
|
| + raise
|
|
|
| break_funcs = [
|
| _UNIVERSE_VIEW.load_recipe(test_description.recipe_name).run_steps,
|
|
|