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,8 +130,9 @@ class SmoketestRun:
return return
cache_simfile: Optional[Simfile] = None cache_simfile: Optional[Simfile] = None
with context.perform("cache.open", path=simfile_path) as context: if self.args.cache_dir:
cache_simfile = self._open_cached_simfile(context, simfile_path=simfile_path) with context.perform("cache.open", path=simfile_path) as context:
cache_simfile = self._open_cached_simfile(context, simfile_path=simfile_path)
with context.perform("simfile.open", path=simfile_path) as context: with context.perform("simfile.open", path=simfile_path) as context:
sim = simfile.open(simfile_path) sim = simfile.open(simfile_path)
@ -142,7 +143,8 @@ class SmoketestRun:
) as context: ) as context:
self._test_simfile(context, sim) self._test_simfile(context, sim)
self._compare_to_cache(context, sim=sim, cache=cache_simfile) if self.args.cache_dir:
self._compare_to_cache(context, sim=sim, cache=cache_simfile)
def _test_simfile(self, context: SimfileContext, sim: Simfile): def _test_simfile(self, context: SimfileContext, sim: Simfile):
with context.perform("TimingData") as context: with context.perform("TimingData") as context: