Skip LRUCacheTest if filelock is not installed

PiperOrigin-RevId: 642709012
This commit is contained in:
Sergei Lebedev 2024-06-12 13:00:50 -07:00 committed by jax authors
parent 8b84997573
commit 69f437d29c

View File

@ -14,6 +14,7 @@
from __future__ import annotations
import importlib.util
import tempfile
import time
@ -29,6 +30,9 @@ class LRUCacheTestCase(jtu.JaxTestCase):
path: pathlib.Path | None
def setUp(self):
if importlib.util.find_spec("filelock") is None:
self.skipTest("filelock is not installed")
super().setUp()
tmpdir = tempfile.TemporaryDirectory()
self.enter_context(tmpdir)