diff --git a/qase-pytest/changelog.md b/qase-pytest/changelog.md index c586e1bf..4087e1d4 100644 --- a/qase-pytest/changelog.md +++ b/qase-pytest/changelog.md @@ -1,4 +1,17 @@ -# qase-pytest 6.1.1b2 +# qase-pytest 6.1.1b4 + +## What's new + +Fix an issue with parameters like this `pytest.mark.parametrize(argnames="foo", argvalues=["bar","baz"])`: + +```log +INTERNALERROR> File "/usr/local/lib/python3.12/site-packages/qase/pytest/plugin.py", line 79, in pytest_collection_modifyitems +INTERNALERROR> param_name, values = mark.args +INTERNALERROR> ^^^^^^^^^^^^^^^^^^ +INTERNALERROR> ValueError: not enough values to unpack (expected 2, got 0) +``` + +# qase-pytest 6.1.1b3 ## What's new diff --git a/qase-pytest/src/qase/pytest/plugin.py b/qase-pytest/src/qase/pytest/plugin.py index 3c560942..f25218f5 100644 --- a/qase-pytest/src/qase/pytest/plugin.py +++ b/qase-pytest/src/qase/pytest/plugin.py @@ -78,10 +78,14 @@ def pytest_collection_modifyitems(self, session, config, items): # Extract single and grouped params from the item's markers for mark in item.iter_markers(): if mark.name == 'parametrize': - param_name, values = mark.args - if ',' in param_name: - grouped_params.append(param_name.split(',')) - + if len(mark.args) != 0: + param_name, values = mark.args + if ',' in param_name: + grouped_params.append(param_name.split(',')) + else: + param_name = mark.kwargs.get('argnames') + if ',' in param_name: + grouped_params.append(param_name.split(',')) # Attach the captured params to the test item item._grouped_params = grouped_params