Debian Codegraph @

tests/conftest.py

raw
1 from pathlib import Path
2 import pytest
3 from shutil import copytree
4
5 samples_dir = Path(__file__).parent / 'samples'
6
7 @pytest.fixture
8 def copy_sample(tmp_path):
9 """Copy a subdirectory from the samples dir to a temp dir"""
10 def copy(dirname):
11 dst = tmp_path / dirname
12 copytree(str(samples_dir / dirname), str(dst))
13 return dst
14
15 return copy