test_util.py 文件源码

python
阅读 21 收藏 0 点赞 0 评论 0

项目:endpoints-python 作者: cloudendpoints 项目源码 文件源码
def testAllExported(self):
    """Test that all public attributes not imported are in __all__."""
    missing_attributes = []
    for attribute in dir(self.MODULE):
      if not attribute.startswith('_'):
        if attribute not in self.MODULE.__all__:
          attribute_value = getattr(self.MODULE, attribute)
          if isinstance(attribute_value, types.ModuleType):
            continue
          # pylint: disable=protected-access
          if isinstance(attribute_value, __future__._Feature):
            continue
          missing_attributes.append(attribute)
    if missing_attributes:
      self.fail('%s are not modules and not defined in __all__.' %
                missing_attributes)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号