From c4785f8d1e26acbd8a327a6e6f7de7ce6f67112f Mon Sep 17 00:00:00 2001 From: Noah Date: Wed, 6 Oct 2021 09:40:24 -0400 Subject: [PATCH] fix: typo in single file extension error message (#553) --- src/syrupy/extensions/single_file.py | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/src/syrupy/extensions/single_file.py b/src/syrupy/extensions/single_file.py index edf64221..f6739a7e 100644 --- a/src/syrupy/extensions/single_file.py +++ b/src/syrupy/extensions/single_file.py @@ -2,7 +2,6 @@ from pathlib import Path from typing import ( TYPE_CHECKING, - Any, Optional, Set, ) @@ -16,11 +15,22 @@ from .base import AbstractSyrupyExtension if TYPE_CHECKING: - from syrupy.types import SerializableData + from syrupy.types import ( + PropertyFilter, + PropertyMatcher, + SerializableData, + SerializedData, + ) class SingleFileSnapshotExtension(AbstractSyrupyExtension): - def serialize(self, data: "SerializableData", **kwargs: Any) -> bytes: + def serialize( + self, + data: "SerializableData", + *, + exclude: Optional["PropertyFilter"] = None, + matcher: Optional["PropertyMatcher"] = None, + ) -> SerializedData: return bytes(data) def get_snapshot_name(self, *, index: int = 0) -> str: @@ -62,7 +72,7 @@ def _read_snapshot_data_from_location( def _write_snapshot_fossil(self, *, snapshot_fossil: "SnapshotFossil") -> None: filepath, data = snapshot_fossil.location, next(iter(snapshot_fossil)).data if not isinstance(data, bytes): - error_text = gettext("Can write non binary data. Expected '{}', got '{}'") + error_text = gettext("Can't write non binary data. Expected '{}', got '{}'") raise TypeError(error_text.format(bytes.__name__, type(data).__name__)) with open(filepath, "wb") as f: f.write(data)