diff --git a/src/syrupy/extensions/amber/serializer.py b/src/syrupy/extensions/amber/serializer.py index 1a1e5ac9..c276b69d 100644 --- a/src/syrupy/extensions/amber/serializer.py +++ b/src/syrupy/extensions/amber/serializer.py @@ -1,3 +1,4 @@ +import functools import os from types import GeneratorType from typing import ( @@ -79,6 +80,7 @@ def write_file(cls, snapshot_fossil: "SnapshotFossil") -> None: f.write(f"\n{cls._marker_divider}\n") @classmethod + @functools.lru_cache() def read_file(cls, filepath: str) -> "SnapshotFossil": """ Read the raw snapshot data (str) from the snapshot file into a dict