New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tags
objects do not support equality checking correctly
#3242
Comments
I can reproduce this: >>> from robot.model import Tags
>>> Tags(['x']) == Tags(['x'])
False This definitely isn't correct, but it luckily ought to be pretty easy to add |
* Add unit tests from both the issue (robotframework#3242) and the issue that started the discussion) (pytest-dev/pytest#5618) Signed-off-by: Stavros Ntentos <133706+stdedos@users.noreply.github.com>
My only objection is that, I don't feel confident enough doing so. Regarless, here(^^) is a PR to consider. |
One thing to take into account is that tags in Robot are case-, space- and underscore-insensitive. In other words, An other thing to consider is that should |
Would it then be acceptable, only for comparison purposes, to normalize everything? ( Or should that be done during init (as it could lower operations per call)?
It seems you have alpha-merged something. Should I retry the patchset? Should I try to implement the normalization above? Do nothing and close? |
Normalization should be done when comparing. We want to preserver the original format so it cannot be done at |
* Add unit tests from both the issue (robotframework#3242) and the issue that started the discussion) (pytest-dev/pytest#5618) Signed-off-by: Stavros Ntentos <133706+stdedos@users.noreply.github.com>
* Add unit tests from both the issue (robotframework#3242) and the issue that started the discussion) (pytest-dev/pytest#5618) * Additional implementation details as per Slack discussion Signed-off-by: Stavros Ntentos <133706+stdedos@users.noreply.github.com>
First review round: * Remove most of the `test__eq__` tests, as they belonged in `test_init_with_iterable_and_normalization_and_sorting` instead * Reuse the "duplicate tags" test * Code style changes
First review round: * Remove most of the `test__eq__` tests, as they belonged in `test_init_with_iterable_and_normalization_and_sorting` instead * Reuse the "duplicate tags" test * Code style changes
First review round: * Remove most of the `test__eq__` tests, as they belonged in `test_init_with_iterable_and_normalization_and_sorting` instead * Reuse the "duplicate tags" test * Code style changes * Fix robotframework/issues#3347
Tags
objects do not support equality checking correctly
I tried to unit-test a listener manipulating tags here: pytest-dev/pytest#5618 (comment) It seems that compares
robot.model.Tags
is kinda tricky. Is this wanted?The text was updated successfully, but these errors were encountered: