Skip to content

Commit

Permalink
Fix for backwards incompatible change to run_keyword
Browse files Browse the repository at this point in the history
  • Loading branch information
robinmackaij committed Jan 31, 2024
1 parent e641a90 commit d3c84e2
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/robot/libraries/BuiltIn.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
from robot.running import Keyword, RUN_KW_REGISTER
from robot.running.context import EXECUTION_CONTEXTS
from robot.utils import (DotDict, escape, format_assign_message, get_error_message,
get_time, html_escape, is_falsy, is_integer, is_list_like,
is_string, is_truthy, Matcher, normalize,
get_time, html_escape, is_dict_like, is_falsy, is_integer,
is_list_like, is_string, is_truthy, Matcher, normalize,
normalize_whitespace, parse_re_flags, parse_time, prepr,
plural_or_not as s, RERAISED_EXCEPTIONS, safe_str,
secs_to_timestr, seq2str, split_from_equals,
Expand Down Expand Up @@ -1907,6 +1907,11 @@ def run_keyword(self, name, *args):
data = lineno = None
result = ctx.test or (ctx.suite.setup if not ctx.suite.has_tests
else ctx.suite.teardown)
# In RF 7, kw.run expands *args, **kwargs. To keep the previous behavior of not
# expanding arguments (i.e. run_keyword only supports positional args) the
# specific backwards incompatible case is handled
if len(args) == 2 and is_list_like(args[0]) and is_dict_like(args[1]):
args = [(args[0],), (args[1],)]
kw = Keyword(name, args=args, parent=data, lineno=lineno)
return kw.run(result, ctx)

Expand Down

0 comments on commit d3c84e2

Please sign in to comment.