Don't do cache stuff if cache not provided

This commit is contained in:
Ash 2025-10-07 20:25:36 -07:00
parent 1994cecde8
commit f3f4f7157f

View file

@ -130,6 +130,7 @@ class SmoketestRun:
return
cache_simfile: Optional[Simfile] = None
if self.args.cache_dir:
with context.perform("cache.open", path=simfile_path) as context:
cache_simfile = self._open_cached_simfile(context, simfile_path=simfile_path)
@ -142,6 +143,7 @@ class SmoketestRun:
) as context:
self._test_simfile(context, sim)
if self.args.cache_dir:
self._compare_to_cache(context, sim=sim, cache=cache_simfile)
def _test_simfile(self, context: SimfileContext, sim: Simfile):