From 0b768199465fd01f3469df7f2aff43765b8309cd Mon Sep 17 00:00:00 2001 From: epenet <6771947+epenet@users.noreply.github.com> Date: Tue, 12 Nov 2024 08:31:04 +0100 Subject: [PATCH] chore: remove unnecessary quotes in type annotations --- src/syrupy/assertion.py | 4 ++-- src/syrupy/extensions/base.py | 4 ++-- src/syrupy/report.py | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/syrupy/assertion.py b/src/syrupy/assertion.py index 6bdb4fcf..6c2bc7e7 100644 --- a/src/syrupy/assertion.py +++ b/src/syrupy/assertion.py @@ -295,8 +295,8 @@ def _assert(self, data: "SerializableData") -> bool: snapshot_name = self.extension.get_snapshot_name( test_location=self.test_location, index=self.index ) - snapshot_data: Optional["SerializedData"] = None - serialized_data: Optional["SerializedData"] = None + snapshot_data: Optional[SerializedData] = None + serialized_data: Optional[SerializedData] = None matches = False assertion_success = False assertion_exception = None diff --git a/src/syrupy/extensions/base.py b/src/syrupy/extensions/base.py index 21ac1c39..ca67393e 100644 --- a/src/syrupy/extensions/base.py +++ b/src/syrupy/extensions/base.py @@ -113,7 +113,7 @@ def discover_snapshots( """ Returns all snapshot collections in test site """ - discovered: "SnapshotCollections" = SnapshotCollections() + discovered = SnapshotCollections() for filepath in walk_snapshot_dir(self.dirname(test_location=test_location)): if self.is_snapshot_location(location=filepath): snapshot_collection = self._read_snapshot_collection( @@ -315,7 +315,7 @@ def __diff_lines(self, a: str, b: str) -> Iterator[str]: yield from map(context_style, self.__limit_context(line.c)) def __diffed_lines(self, a: str, b: str) -> Iterator["DiffedLine"]: - staged_diffed_line: Optional["DiffedLine"] = None + staged_diffed_line: Optional[DiffedLine] = None for line in qdiff(a.splitlines(keepends=True), b.splitlines(keepends=True)): is_context_line = line[0] == " " is_snapshot_line = line[0] == "-" diff --git a/src/syrupy/report.py b/src/syrupy/report.py index fa005423..d13489c8 100644 --- a/src/syrupy/report.py +++ b/src/syrupy/report.py @@ -384,7 +384,7 @@ def _diff_snapshot_collections( {A{1,2}, B{3,4}, D{7,8}} will result in a collection with the contents {A{}, B{}, C{5,6}}. """ - diffed_snapshot_collections: "SnapshotCollections" = SnapshotCollections() + diffed_snapshot_collections = SnapshotCollections() for snapshot_collection1 in snapshot_collections1: snapshot_collection2 = snapshot_collections2.get( snapshot_collection1.location