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

refactor: collapse io and serializer into single class #30

Merged
merged 2 commits into from
Dec 7, 2019

Conversation

noahnu
Copy link
Collaborator

@noahnu noahnu commented Dec 7, 2019

So far we haven't found a use case for separating IO and Serializer logic. I think we can simplify this if we collapse it into a single "serializer".

@noahnu noahnu requested a review from iamogbz December 7, 2019 20:41
a: null
? !!python/object/apply:builtins.frozenset
- - nested, set
: null
is: null
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yaml should be sorting the keys in alphabetical order, so having "tihs" and "is" after "a" is correct. Perhaps an issue with different pyaml versions, or a limitation of "set"?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Not sure why this is happening. Also thought I fixed the issue where it tries to rewrite existing passing snapshots

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I actually deleted this file and reran update snapshots

@@ -1,5 +1,52 @@
from typing import Any, Set, Optional
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

copy & pasted and then swapped "io" for "serializer". If I split this into 2 commits, maybe GitHub would pick up the diff better?

Copy link
Collaborator

Choose a reason for hiding this comment

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

That's annoying. I think it's just the fact that this file existed before, so it does not register it as a move/rename

README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
src/syrupy/assertion.py Outdated Show resolved Hide resolved
@noahnu noahnu merged commit 40a3001 into master Dec 7, 2019
@noahnu noahnu deleted the remove_io_serializer_distinction branch December 7, 2019 23:26
@@ -91,12 +78,11 @@ def __eq__(self, other) -> bool:
def _assert(self, data) -> bool:
self._session.register_assertion(self)
try:
serialized_data = self.serializer.encode(data)
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think we mistakenly reverted the checking without deserializing in this PR 🤦‍♂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants