From 67d21d7b41f73bf7e193caa407fbc49098730c90 Mon Sep 17 00:00:00 2001 From: Dmitrii Gridnev Date: Wed, 12 Nov 2025 14:53:05 +0300 Subject: [PATCH] feat: release version 4.0.6 with updated argument handling - Updated version to 4.0.6 in pyproject.toml. - Replaced deprecated `args` attribute with `values` for `For` and `ForIteration` objects in the listener. - Updated changelog to reflect the new version and changes. This release improves argument handling in the listener, ensuring compatibility with newer implementations. --- qase-robotframework/changelog.md | 6 +++++ qase-robotframework/pyproject.toml | 2 +- .../src/qase/robotframework/listener.py | 23 +++++++++++++++++-- 3 files changed, 28 insertions(+), 3 deletions(-) diff --git a/qase-robotframework/changelog.md b/qase-robotframework/changelog.md index 37ef2f81..c4933ea7 100644 --- a/qase-robotframework/changelog.md +++ b/qase-robotframework/changelog.md @@ -1,3 +1,9 @@ +# qase-robotframework 4.0.6 + +## What's new + +- Using not deprecated `args` attribute for `For` and `ForIteration` objects. + # qase-robotframework 4.0.5 ## What's new diff --git a/qase-robotframework/pyproject.toml b/qase-robotframework/pyproject.toml index 41382fce..5f656d63 100644 --- a/qase-robotframework/pyproject.toml +++ b/qase-robotframework/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "qase-robotframework" -version = "4.0.5" +version = "4.0.6" description = "Qase Robot Framework Plugin" readme = "README.md" authors = [{name = "Qase Team", email = "support@qase.io"}] diff --git a/qase-robotframework/src/qase/robotframework/listener.py b/qase-robotframework/src/qase/robotframework/listener.py index 120d3a60..eceeb0a9 100644 --- a/qase-robotframework/src/qase/robotframework/listener.py +++ b/qase-robotframework/src/qase/robotframework/listener.py @@ -214,8 +214,27 @@ def __parse_steps(self, result) -> List[Step]: step_name = result.body[i].name data = None - if hasattr(result.body[i], "args") and result.body[i].args: - data = ' '.join(str(arg) for arg in result.body[i].args) + # Avoid deprecated args attribute for For and ForIteration objects + # Check class name to identify For/ForIteration objects and use values instead + body_element = result.body[i] + class_name = body_element.__class__.__name__ + + # For and ForIteration objects have deprecated args attribute + # Use values attribute instead for these types + if class_name in ('For', 'ForIteration'): + if hasattr(body_element, "values") and body_element.values: + data = ' '.join(str(val) for val in body_element.values) + else: + # For other types, try to use args if available + # Use getattr to avoid triggering deprecation warning on access + try: + args_value = getattr(body_element, "args", None) + if args_value: + data = ' '.join(str(arg) for arg in args_value) + except (AttributeError, TypeError): + # Fallback to values if args is not available + if hasattr(body_element, "values") and body_element.values: + data = ' '.join(str(val) for val in body_element.values) step = Step( step_type=StepType.GHERKIN,