From 4d1b37a58de1cadd8c3fc3511cf024bab96af0cf Mon Sep 17 00:00:00 2001 From: Charles LeDoux Date: Wed, 27 Dec 2017 17:07:59 -0600 Subject: [PATCH] Call instead of raise pytest.raise() Why: * pytest.raise is not an exception. --- tests/__init__.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/__init__.py b/tests/__init__.py index a806764..1f82ccd 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -34,7 +34,7 @@ def _need_func(testfunc, name, description): def check_func(func): def newfunc(*args, **kwargs): if not testfunc(name): - raise pytest.skip("%s %r is not available" % (description, name)) + pytest.skip("%s %r is not available" % (description, name)) return func(*args, **kwargs) setattr(newfunc, fnameattr, getattr(func, fnameattr)) return newfunc @@ -72,9 +72,9 @@ def needs_codec (program, codec): def check_prog (f): def newfunc (*args, **kwargs): if not patoolib.util.find_program(program): - raise pytest.skip("program `%s' not available" % program) + pytest.skip("program `%s' not available" % program) if not has_codec(program, codec): - raise pytest.skip("codec `%s' for program `%s' not available" % (codec, program)) + pytest.skip("codec `%s' for program `%s' not available" % (codec, program)) return f(*args, **kwargs) setattr(newfunc, fnameattr, getattr(f, fnameattr)) return newfunc @@ -95,7 +95,7 @@ def skip_on_travis(): def check_func(func): def newfunc(*args, **kwargs): if "TRAVIS" in os.environ: - raise pytest.skip("Skip on TRAVIS CI build.") + pytest.skip("Skip on TRAVIS CI build.") return func(*args, **kwargs) setattr(newfunc, fnameattr, getattr(func, fnameattr)) return newfunc