We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent de60716 commit c57b3baCopy full SHA for c57b3ba
src/syrupy/session.py
@@ -127,7 +127,11 @@ def add_visited_snapshots(self, snapshots: SnapshotFiles):
127
128
def remove_unused_snapshots(self):
129
for snapshot_file, unused_snapshots in self.unused_snapshots.items():
130
- if self.discovered_snapshots[snapshot_file] == unused_snapshots:
+ all_discovered_unused = (
131
+ unused_snapshots == self.discovered_snapshots[snapshot_file]
132
+ )
133
+ no_snapshot_written = not self.written_snapshots.get(snapshot_file)
134
+ if all_discovered_unused and no_snapshot_written:
135
os.remove(snapshot_file)
136
continue
137
snapshot_assertion, *_ = self._assertions[snapshot_file].values()
0 commit comments