Skip to content

Commit

Permalink
Make tests use dask distributed scheduler
Browse files Browse the repository at this point in the history
  • Loading branch information
BSchilperoort committed Jul 10, 2024
1 parent 0e654c9 commit adf73de
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ python_version = "3.10"

[tool.ruff]
line-length = 88
exclude = ["docs", "build"]
exclude = ["docs", "build", "tests"]
target-version = "py310"

[tool.ruff.lint]
Expand Down
3 changes: 3 additions & 0 deletions tests/test_datasets/test_fapar_lai.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
from zampy.datasets.dataset_protocol import SpatialBounds
from zampy.datasets.dataset_protocol import TimeBounds
from . import data_folder
import dask.distributed


@pytest.fixture(scope="function")
Expand Down Expand Up @@ -86,6 +87,8 @@ def test_download(self, mock_retrieve, valid_path_config, dummy_dir):
@pytest.mark.slow
def test_ingest(self, dummy_dir):
"""Test ingest function."""
dask.distributed.Client()

ingest_dir = Path(dummy_dir) / "ingest"
ingest_dir.mkdir()

Expand Down
4 changes: 4 additions & 0 deletions tests/test_recipes/test_simple_recipe.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
from zampy.datasets.dataset_protocol import write_properties_file
from zampy.recipe import RecipeManager
from zampy.recipe import convert_time
import dask.distributed



RECIPE_FILE = Path(__file__).parent / "recipes" / "era5_recipe.yml"
Expand All @@ -21,6 +23,8 @@ def test_recipe(tmp_path: Path, mocker):
with (
patch.object(DATASETS["era5"], "download"),
):
dask.distributed.Client()

mocker.patch(
"zampy.recipe.config_loader",
return_value={"working_directory": str(tmp_path.absolute())},
Expand Down

0 comments on commit adf73de

Please sign in to comment.