Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions qase-robotframework/changelog.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
7 changes: 3 additions & 4 deletions qase-robotframework/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"}]
Expand All @@ -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",
]

Expand All @@ -49,8 +49,7 @@ passenv =
commands =
pytest --cov-config=pyproject.toml {posargs}
extras =
all
testing
testing
"""

[tool.setuptools.packages.find]
Expand Down
30 changes: 11 additions & 19 deletions qase-robotframework/src/qase/robotframework/listener.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down