MCPcopy Create free account
hub / github.com/dask/dask / zarr

Function zarr

dask/tests/test_distributed.py:335–355  ·  view source on GitHub ↗
(c)

Source from the content-addressed store, hash-verified

333
334@pytest.fixture(scope="function")
335def zarr(c):
336 zarr_lib = pytest.importorskip("zarr")
337 # Zarr-Python 3 lazily allocates a dedicated thread/IO loop
338 # for to execute async tasks. To avoid having this thread
339 # be picked up as a "leaked thread", we manually trigger it's
340 # creation before using zarr
341 try:
342 _ = zarr_lib.core.sync._get_loop()
343 _ = zarr_lib.core.sync._get_executor()
344 yield zarr_lib
345 except AttributeError:
346 yield zarr_lib
347 finally:
348 # Zarr-Python 3 lazily allocates a IO thread, a thread pool executor, and
349 # an IO loop. Here we clean up these resources to avoid leaking threads
350 # In normal operations, this is done as by an atexit handler when Zarr
351 # is shutting down.
352 try:
353 zarr_lib.core.sync.cleanup_resources()
354 except AttributeError:
355 pass
356
357
358def test_zarr_distributed_roundtrip(c, zarr):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected