Skip to content

Commit

Permalink
Switch on pytest-lazy-fixtures
Browse files Browse the repository at this point in the history
pytest-lazy-fixture has problems with pytest 8+
  • Loading branch information
shadchin committed Aug 16, 2024
1 parent 7798e20 commit 6816f24
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion continuous_integration/environment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ dependencies:
- coverage
- pytest <8.0.0
- 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

0 comments on commit 6816f24

Please sign in to comment.