def IgnoreWarnings(test_func):
  """Disable logging of warning messages.

  If placed above test methods, this annotation will ignore warnings
  displayed by third parties, such as ResourceWarnings due to 'unclosed ssl
  sockets' which are printed in high quantity while running the e2e tests.
  Instead, we can ignore them so that the user can focus on the output from the
  logger.
  """
  def DoTest(self, *args, **kwargs):
    with warnings.catch_warnings():
      warnings.simplefilter("ignore", ResourceWarning)
      warnings.simplefilter("ignore", UserWarning)
      test_func(self, *args, **kwargs)
  return DoTest
Disable logging of warning messages.

If placed above test methods, this annotation will ignore warnings
displayed by third parties, such as ResourceWarnings due to 'unclosed ssl
sockets' which are printed in high quantity while running the e2e tests.
Instead, we can ignore them so that the user can focus on the output from the
logger.
tests/providers/gcp/e2e_cli.py