##// END OF EJS Templates
Add optional message to @skip test decorator.
Fernando Perez -
Show More
@@ -121,14 +121,25 b" skip_doctest = make_label_dec('skip_doctest',"
121 121 etc.""")
122 122
123 123
124 def skip(func):
125 """Decorator - mark a test function for skipping from test suite."""
124 def skip(func,msg=''):
125 """Decorator - mark a test function for skipping from test suite.
126
127 :Parameters:
128
129 func : function
130 Test function to be skipped
131
132 msg : string
133 Optional message to be added.
134 """
126 135
127 136 import nose
128 137
129 138 def wrapper(*a,**k):
130 raise nose.SkipTest("Skipping test for function: %s" %
131 func.__name__)
139 if msg:
140 msg = '\n'+msg
141 raise nose.SkipTest("Skipping test for function: %s%s" %
142 (func.__name__,msg))
132 143
133 144 return apply_wrapper(wrapper,func)
134 145
General Comments 0
You need to be logged in to leave comments. Login now