Skip to content
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

[TESTING] Notification equality uses string representation #691

Closed
matiboy opened this issue Mar 4, 2023 · 2 comments
Closed

[TESTING] Notification equality uses string representation #691

matiboy opened this issue Mar 4, 2023 · 2 comments

Comments

@matiboy
Copy link
Collaborator

matiboy commented Mar 4, 2023

Describe the bug
The test for equality of Notifications in tests uses str equality instead of equality leading to false negatives

To Reproduce

ReactiveTest.on_next(300, Decimal(0)) == ReactiveTest.on_next(300, Decimal("0.0")) # false even though Decimal(0) == Decimal("0.0") is true
ReactiveTest.on_next(300, {"a": 42, "b": 5}) == ReactiveTest.on_next(300, 
 {"b": 5, "a": 42}) # false though {"a": 42, "b": 5} == {"b": 5, "a": 42} is True

Expected behavior
Above examples should be equal

Code or Screenshots
This is caused by using string inside class Notification(Generic[_T]):

def equals(self, other: "Notification[_T]") -> bool:
        """Indicates whether this instance and a specified object are
        equal."""

        other_string = "" if not other else str(other)
        return str(self) == other_string
  • RxPY version: 4.0.4
  • Python version: 3.11.2
@matiboy
Copy link
Collaborator Author

matiboy commented Jun 14, 2023

Just realized that this is a duplicate of #599

@dbrattli Are we still looking for a PR to fix this? I can give it a go...

Also, closing the issue as duplicate

@matiboy matiboy closed this as completed Jun 14, 2023
@matiboy matiboy reopened this Jun 14, 2023
@matiboy
Copy link
Collaborator Author

matiboy commented Jun 14, 2023

Duplicate of #599

@matiboy matiboy marked this as a duplicate of #599 Jun 14, 2023
@matiboy matiboy closed this as not planned Won't fix, can't repro, duplicate, stale Jun 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant