diff --git a/qase-robotframework/changelog.md b/qase-robotframework/changelog.md index ec22d1c9..8f6993c7 100644 --- a/qase-robotframework/changelog.md +++ b/qase-robotframework/changelog.md @@ -1,3 +1,10 @@ +# qase-robotframework 5.0.1 + +## What's new + +- Fixed deprecation warning `'robot.result.Return.args' is deprecated and will be removed in Robot Framework 8.0` by accessing `args` only on `Keyword` result objects and using `values` for all other body element types (`Return`, `For`, `ForIteration`, `While`, `Group`, `IfBranch`, `Try`, `TryBranch`, `Var`, `Continue`, `Break`, `Error`). +- Updated `qase-python-commons` dependency to version `~=5.0.3`. + # qase-robotframework 5.0.0 ## What's new diff --git a/qase-robotframework/pyproject.toml b/qase-robotframework/pyproject.toml index 61f65936..39a0cd7f 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 = "5.0.0" +version = "5.0.1" description = "Qase Robot Framework Plugin" readme = "README.md" authors = [{name = "Qase Team", email = "support@qase.io"}] @@ -24,7 +24,7 @@ classifiers = [ urls = {"Homepage" = "https://github.com/qase-tms/qase-python/tree/main/qase-robotframework"} requires-python = ">=3.9" dependencies = [ - "qase-python-commons~=5.0.0", + "qase-python-commons~=5.0.3", "filelock>=3.12.2", ] @@ -49,8 +49,7 @@ passenv = commands = pytest --cov-config=pyproject.toml {posargs} extras = - all - testing + testing """ [tool.setuptools.packages.find] diff --git a/qase-robotframework/src/qase/robotframework/listener.py b/qase-robotframework/src/qase/robotframework/listener.py index 0933dbab..a36b7697 100644 --- a/qase-robotframework/src/qase/robotframework/listener.py +++ b/qase-robotframework/src/qase/robotframework/listener.py @@ -448,27 +448,19 @@ def __parse_steps(self, result, accumulated_vars: dict = None) -> List[Step]: step_name = result.body[i].name data = None - # 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) + + # Only Keyword objects have a non-deprecated 'args' attribute. + # All other body element types (Return, For, ForIteration, While, + # Group, IfBranch, Try, TryBranch, Var, Continue, Break, Error) + # inherit deprecated 'args' from DeprecatedAttributesMixin + # which will be removed in Robot Framework 8.0. + if class_name == 'Keyword': + if body_element.args: + data = ' '.join(str(arg) for arg in body_element.args) + elif hasattr(body_element, "values") and body_element.values: + data = ' '.join(str(val) for val in body_element.values) # Extract resolved variable values from log messages in this step # This will also accumulate variables from nested messages