__init__.py 文件源码

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

项目:CSB 作者: csb-toolbox 项目源码 文件源码
def _filter(self, factories):
        """
        Filter a list of objects using C{self.labels}.
        """
        filtered = []

        for obj in factories:
            for label in self.labels:
                if hasattr(obj, label) and getattr(obj, label) is True:
                    suite = obj()
                    if not isinstance(suite, unittest.TestSuite):
                        raise ValueError('Custom test function {0} must return a '
                                         'unittest.TestSuite, not {1}'.format(obj.__name__, type(suite)))
                    filtered.append(suite)

        return filtered
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号