Skip to content

Commit b0a2c5f

Browse files
author
Carwyn Pelley
committed
TEST: Extended regexp raised message checks
1 parent a5e9e7c commit b0a2c5f

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

stratify/tests/test_bounded_vinterp.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,9 @@ def test_mismatch_source_target_level_shape(self):
141141
target_bounds = np.zeros((2, 5, 2))
142142
data = np.zeros((3, 4))
143143

144-
msg = 'Expecting the shape of the source and target levels'
144+
msg = ('Expecting the shape of the source and target levels except '
145+
'the axis of interpolation to be identical. '
146+
"\('-', 4, 2\) != \(2, 5, 2\)")
145147
with self.assertRaisesRegexp(ValueError, msg):
146148
bounded_vinterp.interpolate_conservative(target_bounds,
147149
source_bounds, data,
@@ -153,7 +155,8 @@ def test_mismatch_between_source_levels_source_data(self):
153155
target_bounds = np.zeros((2, 4, 2))
154156
data = np.zeros((3, 4))
155157

156-
msg = 'The provided data is not of compatible shape'
158+
msg = ('The provided data is not of compatible shape with the '
159+
"provided source bounds. \('-', 3, 4\) != \(2, 4\)")
157160
with self.assertRaisesRegexp(ValueError, msg):
158161
bounded_vinterp.interpolate_conservative(target_bounds,
159162
source_bounds, data,

0 commit comments

Comments
 (0)