Skip to content

Commit 86c0e6a

Browse files
committed
Add test for every supported archive format.
1 parent 59768b6 commit 86c0e6a

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

test_git_archive_all.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -390,6 +390,24 @@ def test_explicitly_excluded_dir(base_repo, tmpdir, git_env):
390390
repo_tar.getmember('lib/extra/__init__.py')
391391

392392

393+
@pytest.mark.parametrize('format', [
394+
'tar',
395+
'tar.bz2',
396+
'tar.gz',
397+
pytest.param('tar.xz', marks=pytest.mark.skipif(sys.version_info < (3, 3), reason="Requires lzma")),
398+
'tbz2',
399+
'tgz',
400+
pytest.param('txz', marks=pytest.mark.skipif(sys.version_info < (3, 3), reason="Requires lzma")),
401+
'zip',
402+
'bz2',
403+
'gz',
404+
pytest.param('xz', marks=pytest.mark.skipif(sys.version_info < (3, 3), reason="Requires lzma")),
405+
])
406+
def test_formats(base_repo, tmpdir, format):
407+
repo_archive_path = os.path.join(str(tmpdir), 'repo.' + format)
408+
base_repo.archive(repo_archive_path)
409+
410+
393411
def test_pycodestyle():
394412
style = pycodestyle.StyleGuide(repeat=True, max_line_length=240)
395413
report = style.check_files(['git_archive_all.py'])

0 commit comments

Comments
 (0)