Refactor test data a bit, TRY/EXCEPT FTW!
Conversion Should Fail
[Arguments] ${kw} @{args} ${error}= ${type}=${kw.lower()} ${arg_type}= &{kwargs}
${arg} = Evaluate (list($args) + list($kwargs.values()))[0]
- ${arg_type} = Set Variable If $arg_type ${SPACE}(${arg_type}) ${EMPTY}
- ${end} = Set Variable If $error : ${error} .
- Run Keyword And Expect Error
- ... ${{'GLOB' if '*' in $error else 'EQUALS'}}: ValueError: Argument 'argument' got value '${arg}'${arg_type} that cannot be converted to ${type}${end}
- ... ${kw} @{args} &{kwargs}
+ ${message} = Catenate
+ ... Argument 'argument' got value '${arg}'${{" (${arg_type})" if $arg_type else ""}}
+ ... that cannot be converted to ${type}${{": ${error}" if $error else "."}}
+ TRY
+ Run Keyword ${kw} @{args} &{kwargs}
+ EXCEPT ValueError: ${message} type=${{'GLOB' if '*' in $error else 'LITERAL'}}
+ No Operation
+ END
String None is converted to None object
[Arguments] ${kw}
