conftest.py 文件源码

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

项目:mac-package-build 作者: persepolisdm 项目源码 文件源码
def _data_dir_copy(
  # The name of the subdirectory located in data/name to copy.
  subdir_name,
  # The tmpdir object for this test. See
  # https://pytest.org/latest/tmpdir.html.
  tmpdir):

    # Form the source and tmp paths.
    source_data_dir = py.path.local(_DATA_DIR).join(subdir_name)
    tmp_data_dir = tmpdir.join('data', subdir_name)
    # Copy the data.
    shutil.copytree(source_data_dir.strpath, tmp_data_dir.strpath)
    # Return the temporary data directory, so that the copied data can now be
    # used.
    return tmp_data_dir

# Define a fixure for the DataDir object.
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号