util.py 文件源码

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

项目:kbe_server 作者: xiaohaoppy 项目源码 文件源码
def test_both(test_class, **kwargs):
    frozen_tests = types.new_class('Frozen_'+test_class.__name__,
                                   (test_class, unittest.TestCase))
    source_tests = types.new_class('Source_'+test_class.__name__,
                                   (test_class, unittest.TestCase))
    frozen_tests.__module__ = source_tests.__module__ = test_class.__module__
    for attr, (frozen_value, source_value) in kwargs.items():
        setattr(frozen_tests, attr, frozen_value)
        setattr(source_tests, attr, source_value)
    return frozen_tests, source_tests
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号