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
implement hash and __eq__ for vDDDTypes #492
implement hash and __eq__ for vDDDTypes #492
Conversation
This __eq__ implementation is faulty. The .dt property should be compared, too
@@ -518,6 +500,38 @@ def test_prop_TypesFactory(self): | |||
) | |||
|
|||
|
|||
|
|||
vDDDTypes_list = [ | |||
vDDDTypes(pytz.timezone('US/Eastern').localize(datetime(year=2022, month=7, day=22, hour=12, minute=7))), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this use the in_timezone
fixture from the conftest.py
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried to add not too much. Hm. Since many of the arguments do not use a tz, that would create redundant tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you explain how would they be redundant? I don't quite get that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A second or third case with timezone should do the job too. One with same timezone and one with different time zone but same instant in time.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In ae9ac71 I added another time zone. I think, this covers the case:
- time zone differs
- time zone different from no time zone
Since no time zone is also a time zone in my view, all the cases would be covered. What do you think?
This adds tests and an implementation of
__hash__
for vDDDTypes to fix #487.__hash__
.dt
comparison to__eq__
so that the equality is really tested.