Skip zoo archive tests on Travis.

This commit is contained in:
Bastian Kleineidam 2013-02-23 09:01:31 +01:00
parent 165411a54a
commit 0385ad63b5
2 changed files with 21 additions and 6 deletions

View File

@ -87,3 +87,15 @@ def has_codec (program, codec):
if patoolib.program_supports_compression(program, codec): if patoolib.program_supports_compression(program, codec):
return True return True
return patoolib.util.find_program(codec) return patoolib.util.find_program(codec)
def skip_on_travis():
"""Skip test if TRAVIS build environment is detected."""
def check_func(func):
def newfunc(*args, **kwargs):
if "TRAVIS" in os.environ:
raise pytest.skip("Skip on TRAVIS CI build.")
return func(*args, **kwargs)
setattr(newfunc, fnameattr, getattr(func, fnameattr))
return newfunc
return check_func

View File

@ -14,18 +14,21 @@
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
from . import ArchiveTest, Content from . import ArchiveTest, Content
from .. import needs_program from .. import needs_program, skip_on_travis
class TestZoo (ArchiveTest): class TestZoo (ArchiveTest):
program = 'zoo' program = 'zoo'
# On a Travis CI build the test fails.
@skip_on_travis()
@needs_program(program) @needs_program(program)
def test_zoo(self): def test_zoo(self):
self.archive_commands('t.zoo', check=Content.Multifile) self.archive_commands('t.zoo', check=Content.Multifile)
# fails on Travis build - disable for now # On a Travis CI build the test fails.
#@needs_program('file') @skip_on_travis()
#@needs_program(program) @needs_program('file')
#def test_zoo_file(self): @needs_program(program)
# self.archive_commands('t.zoo.foo', skip_create=True, check=Content.Multifile) def test_zoo_file(self):
self.archive_commands('t.zoo.foo', skip_create=True, check=Content.Multifile)