From 69140717d468cf93750c3f54254ca960455bfd1a Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 8 Aug 2023 14:44:03 +0300 Subject: [PATCH] [7.4.x] Improve duplicate values documentation (#11296) Co-authored-by: Bruno Oliveira --- src/_pytest/python.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/_pytest/python.py b/src/_pytest/python.py index b24dc90d8ee..5f8be5d9b9e 100644 --- a/src/_pytest/python.py +++ b/src/_pytest/python.py @@ -1152,7 +1152,7 @@ def setmulti( arg2scope = self._arg2scope.copy() for arg, val in zip(argnames, valset): if arg in params or arg in funcargs: - raise ValueError(f"duplicate {arg!r}") + raise ValueError(f"duplicate parametrization of {arg!r}") valtype_for_arg = valtypes[arg] if valtype_for_arg == "params": params[arg] = val @@ -1243,8 +1243,9 @@ def parametrize( during the collection phase. If you need to setup expensive resources see about setting indirect to do it rather than at test setup time. - Can be called multiple times, in which case each call parametrizes all - previous parametrizations, e.g. + Can be called multiple times per test function (but only on different + argument names), in which case each call parametrizes all previous + parametrizations, e.g. ::