From 2411678c4754d0171c9e54c1e9351a9ed1a97c5f 2008-08-24 05:28:55 From: Fernando Perez Date: 2008-08-24 05:28:55 Subject: [PATCH] Add optional message to @skip test decorator. --- diff --git a/IPython/testing/decorators.py b/IPython/testing/decorators.py index 1a07fe6..9d618b8 100644 --- a/IPython/testing/decorators.py +++ b/IPython/testing/decorators.py @@ -121,14 +121,25 @@ skip_doctest = make_label_dec('skip_doctest', etc.""") -def skip(func): - """Decorator - mark a test function for skipping from test suite.""" +def skip(func,msg=''): + """Decorator - mark a test function for skipping from test suite. + + :Parameters: + + func : function + Test function to be skipped + + msg : string + Optional message to be added. + """ import nose def wrapper(*a,**k): - raise nose.SkipTest("Skipping test for function: %s" % - func.__name__) + if msg: + msg = '\n'+msg + raise nose.SkipTest("Skipping test for function: %s%s" % + (func.__name__,msg)) return apply_wrapper(wrapper,func)