@@ -1073,14 +1073,15 @@ def setmulti(
1073
1073
marks : Iterable [Mark | MarkDecorator ],
1074
1074
scope : Scope ,
1075
1075
param_index : int ,
1076
+ nodeid : str ,
1076
1077
) -> CallSpec2 :
1077
1078
params = self .params .copy ()
1078
1079
indices = self .indices .copy ()
1079
1080
arg2scope = dict (self ._arg2scope )
1080
1081
for arg , val in zip (argnames , valset ):
1081
1082
if arg in params :
1082
1083
raise nodes .Collector .CollectError (
1083
- f"duplicate parametrization of { arg !r} "
1084
+ f"{ nodeid } : duplicate parametrization of { arg !r} "
1084
1085
)
1085
1086
params [arg ] = val
1086
1087
indices [arg ] = param_index
@@ -1235,6 +1236,8 @@ def parametrize(
1235
1236
It will also override any fixture-function defined scope, allowing
1236
1237
to set a dynamic scope using test context or configuration.
1237
1238
"""
1239
+ nodeid = self .definition .nodeid
1240
+
1238
1241
argnames , parametersets = ParameterSet ._for_parametrize (
1239
1242
argnames ,
1240
1243
argvalues ,
@@ -1246,7 +1249,7 @@ def parametrize(
1246
1249
1247
1250
if "request" in argnames :
1248
1251
fail (
1249
- " 'request' is a reserved name and cannot be used in @pytest.mark.parametrize" ,
1252
+ f" { nodeid } : 'request' is a reserved name and cannot be used in @pytest.mark.parametrize" ,
1250
1253
pytrace = False ,
1251
1254
)
1252
1255
@@ -1341,6 +1344,7 @@ def parametrize(
1341
1344
marks = param_set .marks ,
1342
1345
scope = scope_ ,
1343
1346
param_index = param_index ,
1347
+ nodeid = nodeid ,
1344
1348
)
1345
1349
newcalls .append (newcallspec )
1346
1350
self ._calls = newcalls
0 commit comments