From d4be50473314ba191dc134ab588ff30243d44e20 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C4=93teris=20Caune?= Date: Mon, 22 Nov 2021 13:50:05 +0200 Subject: [PATCH] Fixed test_precompiler_cache to clear cache before the test runs (#1078) Fixes: #1077 --- compressor/tests/test_filters.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/compressor/tests/test_filters.py b/compressor/tests/test_filters.py index 7e2ffc76..49716b7b 100644 --- a/compressor/tests/test_filters.py +++ b/compressor/tests/test_filters.py @@ -97,6 +97,9 @@ def test_precompiler_output_unicode(self): self.assertEqual(type(compiler.input()), str) def test_precompiler_cache(self): + # The cache may already have data in it depending on the order the tests are + # run, so start by clearing it: + cache.clear() command = '%s %s -f {infile} -o {outfile}' % (sys.executable, self.test_precompiler) compiler = CachedCompilerFilter(command=command, **self.cached_precompiler_args) self.assertEqual("body { color:#990; }", compiler.input())