Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch on pytest-lazy-fixtures #613

Merged
merged 2 commits into from
Aug 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions continuous_integration/environment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ dependencies:
- xarray
- zarr
- coverage
- pytest <8.0.0
- pytest
- pytest-cov
- pytest-lazy-fixture
- pytest-lazy-fixtures
- importlib-metadata
- sphinx-reredirects
- odc-geo
16 changes: 8 additions & 8 deletions pyresample/test/test_resamplers/test_nearest.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
import numpy as np
import pytest
import xarray as xr
from pytest_lazyfixture import lazy_fixture
from pytest_lazy_fixtures import lf

from pyresample.future.geometry import AreaDefinition, SwathDefinition
from pyresample.future.resamplers import KDTreeNearestXarrayResampler
Expand Down Expand Up @@ -183,9 +183,9 @@ def test_nearest_area_2d_to_area_1n_no_roi_no_geocentric(
assert res.shape == resampler.target_geo_def.shape

@pytest.mark.parametrize("input_data", [
lazy_fixture("data_2d_float32_numpy"),
lazy_fixture("data_2d_float32_dask"),
lazy_fixture("data_2d_float32_xarray_numpy"),
lf("data_2d_float32_numpy"),
lf("data_2d_float32_dask"),
lf("data_2d_float32_xarray_numpy"),
])
def test_object_type_with_warnings(
self,
Expand Down Expand Up @@ -240,8 +240,8 @@ class TestInvalidUsageNearestNeighborResampler:
@pytest.mark.parametrize(
"input_data",
[
lazy_fixture("data_2d_float32_xarray_dask"),
lazy_fixture("data_3d_float32_xarray_dask"),
lf("data_2d_float32_xarray_dask"),
lf("data_3d_float32_xarray_dask"),
]
)
def test_mismatch_geo_data_dims(
Expand Down Expand Up @@ -271,8 +271,8 @@ def test_mismatch_geo_data_dims_swath(
@pytest.mark.parametrize(
"src_geom",
[
lazy_fixture("area_def_stere_source"),
lazy_fixture("swath_def_2d_xarray_dask")
lf("area_def_stere_source"),
lf("swath_def_2d_xarray_dask")
]
)
@pytest.mark.parametrize(
Expand Down
12 changes: 6 additions & 6 deletions pyresample/test/test_resamplers/test_resampler.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
import numpy as np
import pytest
import xarray as xr
from pytest_lazyfixture import lazy_fixture
from pytest_lazy_fixtures import lf

from pyresample.future.resamplers.resampler import Resampler
from pyresample.geometry import AreaDefinition, SwathDefinition
Expand Down Expand Up @@ -57,16 +57,16 @@ def resample(self, data, **kwargs):
@pytest.mark.parametrize(
"src",
[
lazy_fixture("swath_def_2d_numpy"),
lazy_fixture("swath_def_2d_dask"),
lazy_fixture("swath_def_2d_xarray_numpy"),
lazy_fixture("swath_def_2d_xarray_dask"),
lf("swath_def_2d_numpy"),
lf("swath_def_2d_dask"),
lf("swath_def_2d_xarray_numpy"),
lf("swath_def_2d_xarray_dask"),
]
)
@pytest.mark.parametrize(
"dst",
[
lazy_fixture("area_def_lcc_conus_1km"),
lf("area_def_lcc_conus_1km"),
]
)
def test_resampler(src, dst):
Expand Down
Loading