summaryrefslogtreecommitdiffstats
path: root/tests/conftest.py
blob: 4c5ecef158d13d16079671bb1e1b0a59c91cfdfe (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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