1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
|
import shutil
import subprocess
from pathlib import Path
import pytest
from tests import FIXTURES
@pytest.fixture
def fixture_project(tmp_path: Path, name: str, monkeypatch: pytest.MonkeyPatch) -> Path:
project = FIXTURES / "projects" / name
shutil.copytree(project, tmp_path / name)
monkeypatch.chdir(tmp_path / name)
return tmp_path / name
@pytest.fixture
def dist(tmp_path: Path) -> Path:
return tmp_path / "dist"
@pytest.fixture
def scm(fixture_project: Path) -> None:
subprocess.check_call(["git", "config", "--global", "user.email", "you@example.com"])
subprocess.check_call(["git", "config", "--global", "user.name", "Your Name"])
subprocess.check_call(["git", "init"])
subprocess.check_call(["git", "add", "."])
subprocess.check_call(["git", "commit", "-m", "initial commit"])
subprocess.check_call(["git", "tag", "-a", "0.1.0", "-m", "version 0.1.0"])
|