Replace _run_func with an error-handling context manager.

An upcoming change will be changing the signature of the run method on
test objects while leaving the pre_run signature the same. Rather than
trying to update _run_func to accomodate this, a contextmanager that
handles the errors can be used and the test methods can be called as
normal.

Bug: 336589262
Change-Id: Ic86d09a7608361d378a19813c36e7103d175d2c3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/build/+/5689520
Commit-Queue: Ben Pastene <bpastene@chromium.org>
Auto-Submit: Garrett Beaty <gbeaty@google.com>
Reviewed-by: Ben Pastene <bpastene@chromium.org>
1 file changed
tree: 5b58be20b750c6c0fa7697f7a7e034bd9dd439f9
  1. hook-scripts/
  2. infra/
  3. recipes/
  4. scripts/
  5. .gitattributes
  6. .gitignore
  7. .style.yapf
  8. .vpython3
  9. .yapfignore
  10. codereview.settings
  11. DEPS
  12. LICENSE
  13. OWNERS
  14. PRESUBMIT.py
  15. PRESUBMIT_test.py
  16. README.md
  17. WATCHLISTS
README.md

Recipes

If you're here to make a change to ‘recipes’ (the code located in the recipes directory), please take a look at the README for more information pertaining to recipes.

Style

The preferred style is PEP8 with two-space indent. Functions use lowercase_with_underscores, with the exception of the special functions RunSteps and RunTests in recipes. Use yapf (git cl format --no-clang-format) to autoformat new code.