From 07922b2dc9d8eff5ca0e2f8c7374a94d024ce2d1 Mon Sep 17 00:00:00 2001 From: Guillaume Maze Date: Fri, 11 Oct 2024 15:43:38 +0200 Subject: [PATCH] Update test_fetchers_dask_cluster.py --- ...uster.py => test_fetchers_dask_cluster.py} | 21 +++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) rename argopy/tests/{test_fetchers_Dask_cluster.py => test_fetchers_dask_cluster.py} (90%) diff --git a/argopy/tests/test_fetchers_Dask_cluster.py b/argopy/tests/test_fetchers_dask_cluster.py similarity index 90% rename from argopy/tests/test_fetchers_Dask_cluster.py rename to argopy/tests/test_fetchers_dask_cluster.py index e4005be2..6d79337f 100644 --- a/argopy/tests/test_fetchers_Dask_cluster.py +++ b/argopy/tests/test_fetchers_dask_cluster.py @@ -1,13 +1,22 @@ import pytest -import logging +dask = pytest.importorskip("dask", reason="Requires 'Dask' and 'distributed'") +distributed = pytest.importorskip("distributed", reason="Requires 'Dask' and 'distributed'") from dask.distributed import Client + + +import logging from argopy import DataFetcher from collections import ChainMap import xarray as xr from mocked_http import mocked_server_address, mocked_httpserver - +from utils import ( + requires_argovis, + requires_erddap, + requires_gdac, + has_dask, has_distributed, +) log = logging.getLogger("argopy.tests.dask") USE_MOCKED_SERVER = True @@ -72,6 +81,9 @@ def core(fargs, apts): return fetcher +@requires_erddap +@requires_gdac +@requires_argovis class Test_Backend: """Test Dask cluster parallelization""" @@ -129,10 +141,7 @@ def teardown_class(self): indirect=True, ids=VALID_PARALLEL_ACCESS_POINTS_IDS, ) - def test_fetching_erddap(self, mocked_httpserver, fetcher): - # log.debug(fetcher) - # log.debug(len(fetcher.uri)) - # log.debug(fetcher.uri) + def test_data_fetching(self, mocked_httpserver, fetcher): assert len(fetcher.uri) > 1 ds = fetcher.to_xarray()