You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Argument conversion and validation with non-string argument values #3735
When argument conversion was added in RF 3.1 (#2890, #2947, #2932) a decision was made that conversion is done only if the given argument is a Unicode string. This approach has some limitations and a decision has been made to support conversion also with other argument types.
The problem here is that there is an unlimited amount of types users could use and handling all cases sanely is likely not easy. There are, however, many simple and useful cases like converting an integer to a float if a keyword accepts arg: float and accepting numbers with arg: timedelta.
One important decision to be made is handling types we cannot convert. For example, if we have arg: int and it is called with None, what should we do. We can either pass the given argument as-is or, probably better, make it an error. Making this an error is backwards incompatible change, though.
changed the title [-]Argument conversion should work also when given argument isn't a string[/-][+]Argument conversion and validation with non-string argument values[/+]on Oct 25, 2020
Activity
Add argument conversion when given argument is int or float
pekkaklarck commentedon Oct 25, 2020
Conversion logic will be changed like this:
Following converters are enhanced to accept listed non-string values. Unless explicitly noted, value is converted to the expected type.
1.0is ok but1.1is not).All converters also accept values of their own type and pass them as-is.
All other types are considered to be errors.
Remove int -> bytes type conversion.
More non-string argument conversions (#3735)
pekkaklarck commentedon Oct 25, 2020
This issue ought to be done except for updating the User Guide. That will be done soonish when all type conversion enhancements are done.
[-]Argument conversion should work also when given argument isn't a string[/-][+]Argument conversion and validation with non-string argument values[/+]UG: Document argument conversion changes.
Add argument conversion when given argument is int or float
Remove int -> bytes type conversion.
More non-string argument conversions (robotframework#3735)
UG: Document argument conversion changes.