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

Unified Diff: recipe_engine/test.py

Issue 2845133002: Add friendly error message when GenTests is missing or misspelled (Closed)
Patch Set: RunSteps Created 3 years, 7 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 | unittests/test_test.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: recipe_engine/test.py
diff --git a/recipe_engine/test.py b/recipe_engine/test.py
index 68f29c06c2e0048461009d66e24495752ab568aa..e81a12ad1eff37b4053a88e458e1b25808b0d900 100644
--- a/recipe_engine/test.py
+++ b/recipe_engine/test.py
@@ -415,6 +415,9 @@ def get_tests(test_filter=None):
# TODO(phajdan.jr): move expectation tree outside of the recipe tree.
expect_dir = os.path.join(root, '%s.expected' % name)
+ if not recipe.gen_tests:
+ raise Exception('Missing or misspelled GenTests function.')
+
# Immediately convert to list to force running the generator under
# coverage context. Otherwise coverage would only report executing
# the function definition, not GenTests body.
« no previous file with comments | « no previous file | unittests/test_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698