Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions tests/test_sdist.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from pathlib import Path
import pytest
from shutil import which, copytree
from subprocess import run
import sys
import tarfile
from tempfile import TemporaryDirectory
Expand Down Expand Up @@ -73,6 +74,22 @@ def test_get_files_list_git(copy_sample):
pjoin('dir2', 'abc')
}

def test_get_files_list_with_real_git(copy_sample):
if not which('git'):
pytest.skip("requires git")

td = copy_sample('module1_toml')
unicode_file = td / 'café.txt'
unicode_file.write_text('tracked by git', encoding='utf-8')

run(['git', 'init'], cwd=td, check=True, capture_output=True)
run(['git', 'add', '.'], cwd=td, check=True, capture_output=True)

builder = sdist.SdistBuilder.from_ini_path(td / 'pyproject.toml')
files = builder.select_files()

assert unicode_file.name in files

def test_get_files_list_hg(tmp_path):
dir1 = tmp_path / 'dir1'
copytree(str(samples_dir / 'module1_toml'), str(dir1))
Expand Down