Skip to content

Commit f30a3a0

Browse files
committed
account for Dataset having multiple lazy vars
1 parent d0a129a commit f30a3a0

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

xarray/tests/test_backends.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3908,6 +3908,11 @@ async def test_concurrent_load_multiple_objects(
39083908
cls_name,
39093909
) -> None:
39103910
N_OBJECTS = 5
3911+
N_LAZY_VARS = {
3912+
"Variable": 1,
3913+
"DataArray": 1,
3914+
"Dataset": 4,
3915+
} # specific to the create_test_data() used
39113916

39123917
target_class = zarr.AsyncArray
39133918
method_name = "getitem"
@@ -3927,7 +3932,7 @@ async def test_concurrent_load_multiple_objects(
39273932
results = await asyncio.gather(*coros)
39283933

39293934
mocked_meth.assert_called()
3930-
assert mocked_meth.call_count == N_OBJECTS
3935+
assert mocked_meth.call_count == N_OBJECTS * N_LAZY_VARS[cls_name]
39313936
mocked_meth.assert_awaited()
39323937

39333938
for result in results:

0 commit comments

Comments
 (0)