File tree Expand file tree Collapse file tree 1 file changed +14
-10
lines changed Expand file tree Collapse file tree 1 file changed +14
-10
lines changed Original file line number Diff line number Diff line change @@ -200,22 +200,26 @@ def transform_marks_into_decorators(marks):
200200 try :
201201 for m in marks :
202202 md = pytest .mark .MarkDecorator ()
203- if isinstance (m , type (md )):
204- # already a decorator, we can use it
205- marks_mod .append (m )
206- else :
207- if LooseVersion (pytest .__version__ ) >= LooseVersion ('3.0.0' ):
208- md .mark = m
203+
204+ if LooseVersion (pytest .__version__ ) >= LooseVersion ('3.0.0' ):
205+ if isinstance (m , type (md )):
206+ # already a decorator, we can use it
207+ marks_mod .append (m )
209208 else :
210- md .name = m .name
211- # md.markname = m.name
212- md .args = m .args
213- md .kwargs = m .kwargs
209+ md .mark = m
210+ marks_mod .append (md )
211+ else :
212+ # always recreate one, type comparison does not work (all generic stuff)
213+ md .name = m .name
214+ # md.markname = m.name
215+ md .args = m .args
216+ md .kwargs = m .kwargs
214217
215218 # markinfodecorator = getattr(pytest.mark, markinfo.name)
216219 # markinfodecorator(*markinfo.args)
217220
218221 marks_mod .append (md )
222+
219223 except Exception as e :
220224 warn ("Caught exception while trying to mark case: [%s] %s" % (type (e ), e ))
221225 return marks_mod
You can’t perform that action at this time.
0 commit comments