Skip to content

Commit

Permalink
Fix tests expecting AssertionErrors
Browse files Browse the repository at this point in the history
  • Loading branch information
djhoese committed Nov 17, 2023
1 parent f07a571 commit 14331e4
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions pyresample/test/test_kd_tree.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
from unittest import mock

import numpy as np
import pytest

from pyresample import geometry, kd_tree, utils
from pyresample.test.utils import catch_warnings
Expand Down Expand Up @@ -927,8 +928,8 @@ def test_nearest_area_2d_to_area_1n(self):
for val in ninfo[:3]:
# vii, ia, voi
self.assertIsInstance(val, da.Array)
self.assertRaises(AssertionError,
resampler.get_sample_from_neighbour_info, data)
with pytest.raises(ValueError):
resampler.get_sample_from_neighbour_info(data)

# rename data dimensions to match the expected area dimensions
data = data.rename({'my_dim_y': 'y', 'my_dim_x': 'x'})
Expand All @@ -954,8 +955,8 @@ def test_nearest_area_2d_to_area_1n_no_roi(self):
for val in ninfo[:3]:
# vii, ia, voi
self.assertIsInstance(val, da.Array)
self.assertRaises(AssertionError,
resampler.get_sample_from_neighbour_info, data)
with pytest.raises(ValueError):
resampler.get_sample_from_neighbour_info(data)

# rename data dimensions to match the expected area dimensions
data = data.rename({'my_dim_y': 'y', 'my_dim_x': 'x'})
Expand Down Expand Up @@ -997,8 +998,8 @@ def test_nearest_area_2d_to_area_1n_3d_data(self):
for val in ninfo[:3]:
# vii, ia, voi
self.assertIsInstance(val, da.Array)
self.assertRaises(AssertionError,
resampler.get_sample_from_neighbour_info, data)
with pytest.raises(ValueError):
resampler.get_sample_from_neighbour_info(data)

# rename data dimensions to match the expected area dimensions
data = data.rename({'my_dim_y': 'y', 'my_dim_x': 'x'})
Expand Down

0 comments on commit 14331e4

Please sign in to comment.