Skip to content

Commit b10ee82

Browse files
committed
TST: Handle dtype nodata test failures
1 parent 3ca29fb commit b10ee82

File tree

1 file changed

+23
-4
lines changed

1 file changed

+23
-4
lines changed

test/integration/test_integration_rioxarray.py

+23-4
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
from rioxarray.rioxarray import _generate_spatial_coords, _make_coords
3232
from test.conftest import (
3333
GDAL_GE_361,
34+
RASTERIO_GE_14,
3435
TEST_COMPARE_DATA_DIR,
3536
TEST_INPUT_DATA_DIR,
3637
_assert_xarrays_equal,
@@ -805,7 +806,7 @@ def test_reproject_match__non_geospatial(dummy_dataset_non_geospatial):
805806
def test_reproject_match__geographic_dataset():
806807
lat = [0.1, 0.15, 0.2]
807808
lon = [0.1, 0.15, 0.2]
808-
data = numpy.arange(1, 10).reshape(3, 3)
809+
data = numpy.arange(1, 10, dtype=numpy.float32).reshape(3, 3)
809810
ds = xarray.Dataset(
810811
data_vars={
811812
"foo": (["lat", "lon"], data),
@@ -2185,7 +2186,13 @@ def test_reproject_transform_missing_shape():
21852186
"dtype, expected_nodata",
21862187
[
21872188
(numpy.uint8, 255),
2188-
(numpy.int8, -128),
2189+
pytest.param(
2190+
numpy.int8,
2191+
-128,
2192+
marks=pytest.mark.xfail(
2193+
not RASTERIO_GE_14, reason="Not worried about it if it works on latest."
2194+
),
2195+
),
21892196
(numpy.uint16, 65535),
21902197
(numpy.int16, -32768),
21912198
(numpy.uint32, 4294967295),
@@ -2194,8 +2201,20 @@ def test_reproject_transform_missing_shape():
21942201
(numpy.float64, numpy.nan),
21952202
(numpy.complex64, numpy.nan),
21962203
(numpy.complex128, numpy.nan),
2197-
(numpy.uint64, 18446744073709551615),
2198-
(numpy.int64, -9223372036854775808),
2204+
pytest.param(
2205+
numpy.uint64,
2206+
18446744073709551615,
2207+
marks=pytest.mark.xfail(
2208+
not RASTERIO_GE_14, reason="Not worried about it if it works on latest."
2209+
),
2210+
),
2211+
pytest.param(
2212+
numpy.int64,
2213+
-9223372036854775808,
2214+
marks=pytest.mark.xfail(
2215+
not RASTERIO_GE_14, reason="Not worried about it if it works on latest."
2216+
),
2217+
),
21992218
],
22002219
)
22012220
def test_reproject_default_nodata(dtype, expected_nodata):

0 commit comments

Comments
 (0)