@@ -894,8 +894,6 @@ def setmulti(self, valtypes, argnames, valset, id, keywords, scopenum,
894
894
getattr (self , valtype_for_arg )[arg ] = val
895
895
self .indices [arg ] = param_index
896
896
self ._arg2scopenum [arg ] = scopenum
897
- if val is _notexists :
898
- self ._emptyparamspecified = True
899
897
self ._idlist .append (id )
900
898
self .keywords .update (keywords )
901
899
@@ -1014,6 +1012,15 @@ def parametrize(self, argnames, argvalues, indirect=False, ids=None,
1014
1012
argvalues = [(val ,) for val in argvalues ]
1015
1013
if not argvalues :
1016
1014
argvalues = [(_notexists ,) * len (argnames )]
1015
+ # we passed a empty list to parameterize, skip that test
1016
+ #
1017
+ fs , lineno = getfslineno (self .function )
1018
+ newmark = pytest .mark .skip (
1019
+ reason = "got empty parameter set %r, function %s at %s:%d" % (
1020
+ argnames , self .function .__name__ , fs , lineno ))
1021
+ newmarks = newkeywords .setdefault (0 , {})
1022
+ newmarks [newmark .markname ] = newmark
1023
+
1017
1024
1018
1025
if scope is None :
1019
1026
scope = "function"
@@ -1206,12 +1213,12 @@ def _showfixtures_main(config, session):
1206
1213
assert fixturedefs is not None
1207
1214
if not fixturedefs :
1208
1215
continue
1209
- fixturedef = fixturedefs [ - 1 ]
1210
- loc = getlocation (fixturedef .func , curdir )
1211
- available .append ((len (fixturedef .baseid ),
1212
- fixturedef .func .__module__ ,
1213
- curdir .bestrelpath (loc ),
1214
- fixturedef .argname , fixturedef ))
1216
+ for fixturedef in fixturedefs :
1217
+ loc = getlocation (fixturedef .func , curdir )
1218
+ available .append ((len (fixturedef .baseid ),
1219
+ fixturedef .func .__module__ ,
1220
+ curdir .bestrelpath (loc ),
1221
+ fixturedef .argname , fixturedef ))
1215
1222
1216
1223
available .sort ()
1217
1224
currentmodule = None
@@ -1703,15 +1710,6 @@ def runtest(self):
1703
1710
self .ihook .pytest_pyfunc_call (pyfuncitem = self )
1704
1711
1705
1712
def setup (self ):
1706
- # check if parametrization happend with an empty list
1707
- try :
1708
- self .callspec ._emptyparamspecified
1709
- except AttributeError :
1710
- pass
1711
- else :
1712
- fs , lineno = self ._getfslineno ()
1713
- pytest .skip ("got empty parameter set, function %s at %s:%d" % (
1714
- self .function .__name__ , fs , lineno ))
1715
1713
super (Function , self ).setup ()
1716
1714
fillfixtures (self )
1717
1715
0 commit comments