pytester.py 文件源码

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

项目:godot-python 作者: touilleMan 项目源码 文件源码
def getitem(self,  source, funcname="test_func"):
        """Return the test item for a test function.

        This writes the source to a python file and runs pytest's
        collection on the resulting module, returning the test item
        for the requested function name.

        :param source: The module source.

        :param funcname: The name of the test function for which the
           Item must be returned.

        """
        items = self.getitems(source)
        for item in items:
            if item.name == funcname:
                return item
        assert 0, "%r item not found in module:\n%s\nitems: %s" %(
                  funcname, source, items)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号