def setup(*setup_functions):
  """Decorator that reigsters setup functions with a test.

  The functions passed in as setup functions take an optional 'context'
  parameter of type checkers.Context.

  Note that the decorator takes in Test instances, so this decorator should be
  used *above* the @checkers.test decorator (so that the @checkers.test
  decorator will have already been applied and returned a Test instance.)

  Args:
    *setup_functions: (functions) Functions to be called before the test runs.

  Returns:
    function: Decorator that will add setup functions to the test.
  """
  def setup_decorator(checkers_test):
    for setup_function in setup_functions:
      checkers_test.setup.register(setup_function)
    return checkers_test
  return setup_decorator