File: conftest.py

package info (click to toggle)
flit 3.12.0-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,504 kB
  • sloc: python: 6,691; makefile: 175; sh: 27
file content (15 lines) | stat: -rw-r--r-- 372 bytes parent folder | download | duplicates (4)
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