Document that Run Keyword
variants do not support named arguments
#5025
Milestone
Run Keyword
variants do not support named arguments
#5025
Robot Framework Version: 7.0 (also occurs on 6.1.1)
Python interpreter version: 3.11.3
OS: Windows 10 and RHEL
Run Keyword and Expect Error fails when expected_error is a named argument (expected_error=thing) it will look for an error beginning with the string expected_error=
Example passing and failing TC using positional and named arg respectively
*** Test Cases ***
TestExpectErrorPositionalArg
Run Keyword And Expect Error
... REGEXP:^.abc123.$
... Fail
... msg=Error message including substring abc123 to be matched against
TestExpectErrorNamedArg
Run Keyword And Expect Error
... expected_error=REGEXP:^.abc123.$
... Fail
... msg=Error message including substring abc123 to be matched against
Error message from test2:
Expected error '**expected_error=**REGEXP:^.abc123.$' but got 'Error message including substring abc123 to be matched against'.
You can see that it is searching for a literal string beginning with expected_error= and REGEX prefix isn't considered to be at beginning of line so isn't parsed.
I think as written the _error_is_expected function doesn't handle named variables correctly.
The text was updated successfully, but these errors were encountered: