utils.py 文件源码

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

项目:shmlast 作者: camillescott 项目源码 文件源码
def datadir(tmpdir, request):
    '''
    Fixture responsible for locating the test data directory and copying it
    into a temporary directory.
    '''
    filename = request.module.__file__
    test_dir = os.path.dirname(filename)
    data_dir = os.path.join(test_dir, 'data') 
    dir_util.copy_tree(data_dir, str(tmpdir))

    def getter(filename, as_str=True):
        filepath = tmpdir.join(filename)
        if as_str:
            return str(filepath)
        return filepath

    return getter
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号