From 6d1770187e5f79eb70332f81bc7b2337186f2825 Mon Sep 17 00:00:00 2001 From: Noah Date: Thu, 3 Nov 2022 16:07:31 -0400 Subject: [PATCH] fix: lru_cache on snapshot reads (#629) --- src/syrupy/extensions/amber/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/syrupy/extensions/amber/__init__.py b/src/syrupy/extensions/amber/__init__.py index ed8fa4af..91efdc11 100644 --- a/src/syrupy/extensions/amber/__init__.py +++ b/src/syrupy/extensions/amber/__init__.py @@ -47,9 +47,10 @@ def _file_extension(self) -> str: def _read_snapshot_fossil(self, snapshot_location: str) -> "SnapshotFossil": return DataSerializer.read_file(snapshot_location) + @staticmethod @lru_cache() def __cacheable_read_snapshot( - self, snapshot_location: str, cache_key: str + snapshot_location: str, cache_key: str ) -> "SnapshotFossil": return DataSerializer.read_file(snapshot_location)