  class TestFileDownload(unittest.TestCase):
  
    def compare_loads(self, url, start=0, length=None):
      """Compares range between cached and non cached version"""
      shutil.rmtree(CACHE_DIR)
  
      file_cached = URLFile(url, cache=True)
      file_downloaded = URLFile(url, cache=False)
  
      file_cached.seek(start)
      file_downloaded.seek(start)
 
</s> remove 
os.environ["COMMA_CACHE"] = "/tmp/__test_cache__"
from openpilot.tools.lib.url_file import URLFile, CACHE_DIR
 </s> add from openpilot.tools.lib.url_file import URLFile
from tools.lib.tests import temporary_cache_dir </s> remove import shutil
 </s> add 
  class TestFileDownload(unittest.TestCase):
  
    def compare_loads(self, url, start=0, length=None):
      """Compares range between cached and non cached version"""


      file_cached = URLFile(url, cache=True)
      file_downloaded = URLFile(url, cache=False)
  
      file_cached.seek(start)
      file_downloaded.seek(start)
keep keep keep keep replace replace keep keep keep keep keep
 Tests: test_caching reduce global state (#29681) 
tools/lib/tests/test_caching.py