Skip to content

Commit

Permalink
skip compression tests if system executable not available
Browse files Browse the repository at this point in the history
  • Loading branch information
jdidion committed Jun 14, 2017
1 parent b90e2cc commit 38010a7
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tests/test_formats.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,8 @@ def _test_format(self, fmt):
self.assertEqual(fmt.default_compresslevel, fmt._get_compresslevel(None))
self.assertEqual(fmt.compresslevel_range[0], fmt._get_compresslevel(-1))
self.assertEqual(fmt.compresslevel_range[1], fmt._get_compresslevel(100))


@skipIf(gz_path is None, "'gzip' not available")
def test_gzip(self):
gz = get_format('gz')
self._test_format(gz)
Expand Down Expand Up @@ -131,6 +132,7 @@ def test_bgzip(self):
bgz.get_command('d', 'foo.gz'),
[bgz_path, '-d', '-c', '-@', '2', 'foo.gz'])

@skipIf(bz_path is None, "'bzip2' not available")
def test_bzip2(self):
bz = get_format('bz2')
self._test_format(bz)
Expand Down Expand Up @@ -166,6 +168,7 @@ def test_pbzip2(self):
bz.get_command('d', 'foo.bz2'),
[bz_path, '-d', '-c', '-p2', 'foo.bz2'])

@skipIf(xz_path is None, "'xz' not available")
def test_lzma(self):
xz = get_format('xz')
self._test_format(xz)
Expand Down

0 comments on commit 38010a7

Please sign in to comment.