Skip to content

Commit 7d389ab

Browse files
author
Sylvain MARIE
committed
Improved error message when a fixture parametrized with several argnames as once is not able to unpack the parameter values received (non subscriptable object).
1 parent 1c52dfd commit 7d389ab

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

pytest_cases/fixture_parametrize_plus.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1023,7 +1023,10 @@ def replace_paramfixture_with_values(kwargs): # noqa
10231023
# and add instead the parameter values
10241024
if nb_params > 1:
10251025
for i, p in enumerate(argnames): # noqa
1026-
kwargs[p] = encompassing_fixture[i]
1026+
try:
1027+
kwargs[p] = encompassing_fixture[i]
1028+
except TypeError:
1029+
raise Exception("Unable to unpack parameter value to a tuple: %r" % encompassing_fixture)
10271030
else:
10281031
kwargs[argnames[0]] = encompassing_fixture
10291032
# return

0 commit comments

Comments
 (0)