Skip to content

Possible issue with Should Be Equal and type=? #5647

@aurelienrb

Description

@aurelienrb

Hello,

I'm new to Robot Framework, and to learn it I wrote a simple example using the BuiltIn library. And I'm confused about the output of the following test case:

TestInt
    Should Be Equal              10  10                 # PASS
    Should Be Equal As Integers  10  10                 # PASS
    Should Be Equal              10  10  types=int      # PASS
    Should Be Equal              10  10  types=int|int  # PASS
    Should Be Equal              10  10  type=int       # FAIL

The last line fails with the following error:

ValueError: Argument 'first' got value '10' that does not match type 'int'.

I would expect this last test to pass, and the error message let me think there's indeed an issue here as 10 is an int. This new syntax was merged in December 2025 and it seems the error is raised by the following code:

        elif not converter.no_conversion_needed(first):
            raise ValueError(
                f"Argument 'first' got value {first!r} that does not "
                f"match type {type!r}."
            )

This code is backed up by the following test that I don't understand:

First argument must match `type`
    [Documentation]    FAIL
    ...    Several failures occurred:
    ...
    ...    1) ValueError: Argument 'first' got value '42' that does not match type 'int'.
    42                   42              type=int

Why is this test case documented as FAIL? What am I missing with type=int that is different from other syntax such as types=int?

Thanks for your help.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions