color_test.py 文件源码

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

项目:Projects 作者: it2school 项目源码 文件源码
def colorspaces_converted_should_not_raise (self, prop):
        fails = 0

        x = 0
        for c in rgba_combos_Color_generator():
            x += 1

            other = pygame.Color(0)

            try:
                setattr(other, prop, getattr(c, prop))
                #eg other.hsla = c.hsla

            except ValueError:
                fails += 1

        self.assert_(x > 0, "x is combination counter, 0 means no tests!")
        self.assert_((fails, x) == (0, x))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号