Skip to content

Commit 31115b4

Browse files
committed
Fix the error string in matched in testing to match what is generated by the backend
1 parent aaccbe6 commit 31115b4

File tree

4 files changed

+4
-7
lines changed

4 files changed

+4
-7
lines changed

Diff for: tripy/docs/post0_developer_guides/how-to-add-new-ops.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,7 @@ class TestTheta:
390390
# which ensures that we emit an error if the `dim` parameter is outside
391391
# the allowed range.
392392
def test_invalid_dim(self):
393-
with helper.raises(tp.TripyException, match="iota dimension cannot go beyond the output rank or be negative."):
393+
with helper.raises(tp.TripyException, match="iota dimension cannot go beyond the output rank"):
394394
tp.theta([2, 3], dim=3).eval()
395395
```
396396

Diff for: tripy/tests/backend/mlir/test_compiler.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def test_reshape_invalid_volume(self):
3939

4040
with helper.raises(
4141
tp.TripyException,
42-
r"output_shape is incompatible with input type of operation: input has 4 elements, but output_shape has 9",
42+
r"number of output elements \(9\) doesn't match expected number of elements \(4\)",
4343
has_stack_info_for=[tensor, reshaped],
4444
):
4545
reshaped.eval()

Diff for: tripy/tests/frontend/test_shape.py

+1-4
Original file line numberDiff line numberDiff line change
@@ -344,10 +344,7 @@ def test_unary_elementwise_fails_at_run_time(self, values):
344344
with raises(
345345
tp.TripyException,
346346
match=(
347-
"must be ranked tensor of f8E4M3B11FNUZ type or f8E4M3FN type or f8E4M3FNUZ type "
348-
"or f8E5M2 type or f8E5M2FNUZ type or 16-bit float or 32-bit float or 64-bit float or bfloat16 "
349-
"type or complex type with 32-bit float or 64-bit float elements or 4/8/16/32-bit uniform "
350-
"quantized signed integer or 4/8/16/32-bit uniform quantized unsigned integer values"
347+
"'stablehlo.exponential' op operand #0 must be ranked tensor of"
351348
),
352349
):
353350
v.eval()

Diff for: tripy/tests/frontend/trace/ops/test_reshape.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ def test_incorrect_dims(self):
5555

5656
with helper.raises(
5757
tp.TripyException,
58-
match="output_shape is incompatible with input type of operation: input has 4 elements, but output_shape has 1",
58+
match="number of output elements \(1\) doesn't match expected number of elements \(4\)",
5959
has_stack_info_for=[a, b],
6060
):
6161
b.eval()

0 commit comments

Comments
 (0)