From 017f9a155cc35abff7b66fef1b1089b3007e02a8 Mon Sep 17 00:00:00 2001 From: Bastian Kleineidam Date: Tue, 23 Feb 2010 07:32:13 +0100 Subject: [PATCH] Ensure executable exists when checking encoding for a program --- tests/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/__init__.py b/tests/__init__.py index 4024c5e..3f60268 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -56,7 +56,6 @@ class ArchiveTest (unittest.TestCase): def archive_test (self, filename): archive = os.path.join(datadir, filename) - print "XXX1", self.program patoolib._handle_archive(archive, 'test', program=self.program) patoolib._handle_archive(archive, 'test', program=self.program, verbose=True) @@ -99,6 +98,8 @@ def needs_codec (program, codec): """Decorator skipping test if given program codec is not available.""" def check_prog (f): def newfunc (*args, **kwargs): + if not find_executable(program): + raise nose.SkipTest("program `%s' not available" % program) if not find_codec(program, codec): raise nose.SkipTest("codec `%s' for program `%s' not available" % (codec, program)) return f(*args, **kwargs)