flit/tests/conftest.py

16 lines
372 B
Python
Raw Permalink Normal View History

2022-09-06 17:47:45 +08:00
from pathlib import Path
import pytest
from shutil import copytree
samples_dir = Path(__file__).parent / 'samples'
@pytest.fixture
def copy_sample(tmp_path):
"""Copy a subdirectory from the samples dir to a temp dir"""
def copy(dirname):
dst = tmp_path / dirname
copytree(str(samples_dir / dirname), str(dst))
return dst
return copy