INNER CODE UNIT · Python

_cache

GoogleCloudPlatform/terraform-python-testing-helper · tftest.py:413

  def _cache(func):
    sig = inspect.signature(func)

    def cache(self, *args, **kwargs):
      """
      Runs the tftest instance method or retreives the cache value if it exists

      Args:
          kwargs: Keyword argument that are passed to the decorated method
      Returns:
          Output of the tftest instance method
      """
      _LOGGER.info("Cache decorated method: %s", func.__name__)

      if not self.enable_cache:
        return func(self, *args, **kwargs)

      method_args = sig.bind(self, *args, **kwargs).arguments

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…