From f3f4f7157fb4131ab7572f7fe05c4adc90f52fb2 Mon Sep 17 00:00:00 2001 From: Ash Date: Tue, 7 Oct 2025 20:25:36 -0700 Subject: [PATCH] Don't do cache stuff if cache not provided --- src/simfile_smoketest/runner.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/simfile_smoketest/runner.py b/src/simfile_smoketest/runner.py index b4ac46b..23aecee 100644 --- a/src/simfile_smoketest/runner.py +++ b/src/simfile_smoketest/runner.py @@ -130,8 +130,9 @@ class SmoketestRun: return cache_simfile: Optional[Simfile] = None - with context.perform("cache.open", path=simfile_path) as context: - cache_simfile = self._open_cached_simfile(context, simfile_path=simfile_path) + 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) with context.perform("simfile.open", path=simfile_path) as context: sim = simfile.open(simfile_path) @@ -142,7 +143,8 @@ class SmoketestRun: ) as context: 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): with context.perform("TimingData") as context: