Skip to content

Commit 7fc5ece

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

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

test/integration/test_integration_rioxarray.py

+13-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,7 @@ def test_reproject_transform_missing_shape():
21852186
"dtype, expected_nodata",
21862187
[
21872188
(numpy.uint8, 255),
2188-
(numpy.int8, -128),
2189+
pytest.param(numpy.int8, -128, marks=pytest.mark.xfail(not RASTERIO_GE_14)),
21892190
(numpy.uint16, 65535),
21902191
(numpy.int16, -32768),
21912192
(numpy.uint32, 4294967295),
@@ -2194,8 +2195,16 @@ def test_reproject_transform_missing_shape():
21942195
(numpy.float64, numpy.nan),
21952196
(numpy.complex64, numpy.nan),
21962197
(numpy.complex128, numpy.nan),
2197-
(numpy.uint64, 18446744073709551615),
2198-
(numpy.int64, -9223372036854775808),
2198+
pytest.param(
2199+
numpy.uint64,
2200+
18446744073709551615,
2201+
marks=pytest.mark.xfail(not RASTERIO_GE_14),
2202+
),
2203+
pytest.param(
2204+
numpy.int64,
2205+
-9223372036854775808,
2206+
marks=pytest.mark.xfail(not RASTERIO_GE_14),
2207+
),
21992208
],
22002209
)
22012210
def test_reproject_default_nodata(dtype, expected_nodata):

0 commit comments

Comments
 (0)