Skip to content

Commit

Permalink
fix(json): use forward references for py3.7 compatibility (#586)
Browse files Browse the repository at this point in the history
  • Loading branch information
Noah committed Jan 25, 2022
1 parent 68f78e1 commit 8f0db02
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/syrupy/extensions/json/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,14 @@ def __is_namedtuple(cls, obj: Any) -> bool:
@classmethod
def _filter(
cls,
data: SerializableData,
data: "SerializableData",
*,
depth: int = 0,
path: PropertyPath,
exclude: Optional["PropertyFilter"] = None,
matcher: Optional[PropertyMatcher] = None,
visited: Optional[Set[Any]] = None,
) -> SerializableData:
) -> "SerializableData":
data_id = id(data)
visited = set() if visited is None else visited
if depth > cls._max_depth or data_id in visited:
Expand Down Expand Up @@ -141,7 +141,7 @@ def serialize(

def _read_snapshot_data_from_location(
self, *, snapshot_location: str, snapshot_name: str
) -> Optional[SerializableData]:
) -> Optional["SerializableData"]:
try:
return Path(snapshot_location).read_text(encoding="utf-8")
except FileNotFoundError:
Expand Down

0 comments on commit 8f0db02

Please sign in to comment.