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)
评论列表
文章目录