| Index: unittests/errors_test.py
|
| diff --git a/unittests/errors_test.py b/unittests/errors_test.py
|
| index 66dab8bc6f0605ed31723108e17e438c1d7a42f7..15cb5b051e6e19c4f5f47e553e983d6e7423ac58 100755
|
| --- a/unittests/errors_test.py
|
| +++ b/unittests/errors_test.py
|
| @@ -293,6 +293,9 @@ from recipe_engine import step_runner
|
| def bad_print_step(self, step_stream, step, env):
|
| raise Exception("Buh buh buh buh bad to the bone")
|
|
|
| +def GenTests(api):
|
| + pass
|
| +
|
| def RunSteps(api):
|
| step_runner.SubprocessStepRunner._print_step = bad_print_step
|
| try:
|
| @@ -306,6 +309,29 @@ def RunSteps(api):
|
| r'(?s)Recipe engine bug.*Buh buh buh buh bad to the bone'),
|
| retcode=2)
|
|
|
| + def test_missing_method(self):
|
| + with RecipeRepo() as repo:
|
| + repo.make_recipe('no_gen_tests', """
|
| +def RunSteps(api):
|
| + pass
|
| +""")
|
| + repo.make_recipe('no_run_steps', """
|
| +def GenTests(api):
|
| + pass
|
| +""")
|
| +
|
| + self._test_cmd(repo, ['run', 'no_gen_tests'],
|
| + asserts=lambda stdout, stderr: self.assertRegexpMatches(
|
| + stdout + stderr,
|
| + r'(?s)misspelled GenTests'),
|
| + retcode=2)
|
| +
|
| + self._test_cmd(repo, ['run', 'no_run_steps'],
|
| + asserts=lambda stdout, stderr: self.assertRegexpMatches(
|
| + stdout + stderr,
|
| + r'(?s)misspelled RunSteps'),
|
| + retcode=2)
|
| +
|
| def test_unconsumed_assertion(self):
|
| # There was a regression where unconsumed exceptions would not be detected
|
| # if the exception was AssertionError.
|
|
|