Run AR format tests only on POSIX systems.
This commit is contained in:
parent
37fa891535
commit
9a420df3a4
|
@ -105,6 +105,18 @@ class ArchiveTest (unittest.TestCase):
|
|||
shutil.rmtree(tmpdir)
|
||||
|
||||
|
||||
def needs_os (name):
|
||||
"""Decorator skipping test if given program is not available."""
|
||||
def check_prog (f):
|
||||
def newfunc (*args, **kwargs):
|
||||
if os.name != name:
|
||||
raise nose.SkipTest("operating system %s not found" % name)
|
||||
return f(*args, **kwargs)
|
||||
newfunc.func_name = f.func_name
|
||||
return newfunc
|
||||
return check_prog
|
||||
|
||||
|
||||
def needs_program (program):
|
||||
"""Decorator skipping test if given program is not available."""
|
||||
def check_prog (f):
|
||||
|
|
|
@ -213,6 +213,7 @@ class TestArchives (ArchiveTest):
|
|||
self.program = 'arj'
|
||||
self.archive_commands('t.arj')
|
||||
|
||||
@needs_os('posix')
|
||||
@needs_program('ar')
|
||||
def test_ar (self):
|
||||
self.program = 'ar'
|
||||
|
|
|
@ -243,6 +243,7 @@ class TestArchives (ArchiveTest):
|
|||
self.program = 'arj'
|
||||
self.archive_commands('t.arj.foo', format="arj")
|
||||
|
||||
@needs_os('posix')
|
||||
@needs_program('file')
|
||||
@needs_program('ar')
|
||||
def test_ar (self):
|
||||
|
|
Loading…
Reference in New Issue