test_message.py 文件源码

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

项目:capnpy 作者: antocuni 项目源码 文件源码
def test_dumps_not_compact_no_fastpath(self, schema, benchmark):
        if schema.__name__ != 'Capnpy':
            pytest.skip('N/A')
        #
        def dumps_N(obj):
            myobjs = (obj, obj)
            res = 0
            for i in range(self.N):
                obj = myobjs[i%2]
                res = obj.dumps(fastpath=False)
            return res
        #
        obj = get_obj(schema)
        container = schema.MyStructContainer(items=[obj, obj])
        obj0 = container.items[0]
        assert not obj0._is_compact()
        res = benchmark(dumps_N, obj0)
        assert type(res) is six.binary_type
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号