@@ -255,14 +255,25 @@ def __init__(self, progress: "SnapshotFileProgress", testname: str):
255255 self .__progress = progress
256256 self ._testname = testname
257257
258- def read_disk (self , sub : str , call : CallStack ) -> Optional [Snapshot ]:
259- raise NotImplementedError ()
260-
261- def write_disk (self , actual : Snapshot , sub : str , call : CallStack ):
262- raise NotImplementedError ()
258+ def read_disk (self , sub : str , call : "CallStack" ) -> Optional ["Snapshot" ]:
259+ return self .__progress .read (self ._testname , self ._suffix (sub ))
260+
261+ def write_disk (self , actual : "Snapshot" , sub : str , call : "CallStack" ):
262+ self .__progress .write (
263+ self ._testname ,
264+ self ._suffix (sub ),
265+ actual ,
266+ call ,
267+ self .__progress .system .layout ,
268+ )
263269
264270 def keep (self , sub_or_keep_all : Optional [str ]):
265- self .__progress .keep (self ._testname , sub_or_keep_all )
271+ self .__progress .keep (
272+ self ._testname , self ._suffix (sub_or_keep_all ) if sub_or_keep_all else None
273+ )
274+
275+ def _suffix (self , sub : str ) -> str :
276+ return f"/{ sub } " if sub else ""
266277
267278
268279class SnapshotFileProgress :
@@ -335,11 +346,13 @@ def __all_tests_finished(self):
335346 if tests == SnapshotFileProgress .TERMINATED :
336347 raise ValueError (f"Snapshot for { self .test_file } already terminated!" )
337348 if self .file is not None :
338- stale_snapshot_indices = WithinTestGC .find_stale_snapshots_within (
339- self .file .snapshots ,
340- tests ,
341- find_test_methods_that_didnt_run (self .test_file , tests ),
342- )
349+ # TODO: figure out GC
350+ stale_snapshot_indices = []
351+ # stale_snapshot_indices = WithinTestGC.find_stale_snapshots_within(
352+ # self.file.snapshots,
353+ # tests,
354+ # find_test_methods_that_didnt_run(self.test_file, tests),
355+ # )
343356 if stale_snapshot_indices or self .file .was_set_at_test_time :
344357 self .file .remove_all_indices (stale_snapshot_indices )
345358 snapshot_path = self .system ._layout .snapshotfile_for_testfile (
0 commit comments