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

Fix issue not recognizing that, in JSON, 1 != 1.0 != True #106

Merged
merged 4 commits into from
Jan 29, 2020

Conversation

blakehilliard
Copy link

Jonathan Hilliard added 3 commits January 28, 2020 10:50
…nders 2 values.

This avoids flagging mismatches between classes which happen to be different but which are JSONified as the same thing.
@coveralls
Copy link

coveralls commented Jan 28, 2020

Coverage Status

Coverage decreased (-0.06%) to 64.914% when pulling c1fce71 on blakehilliard:only-type-diff into 3e44e04 on stefankoegl:master.

isinstance(dst, MutableMapping):
self._compare_dicts(_path_join(path, key), src, dst)

elif isinstance(src, MutableSequence) and \
isinstance(dst, MutableSequence):
self._compare_lists(_path_join(path, key), src, dst)

elif json.dumps(src) == json.dumps(dst):
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please ask a comment to describe this comparison? It makes sense now in the context of this pull request, but it might be confusing if you look at it a year from now.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done, plus a note about how performance could later be improved.

@stefankoegl stefankoegl merged commit 91f6124 into stefankoegl:master Jan 29, 2020
@stefankoegl
Copy link
Owner

Thanks! I have just released v1.25 with this fix.

@blakehilliard blakehilliard deleted the only-type-diff branch January 29, 2020 15:23
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

Successfully merging this pull request may close these issues.

None yet

3 participants