Skip to content

Commit

Permalink
test[next]: Fix warnings that cause Spack to crash (#1369)
Browse files Browse the repository at this point in the history
Solves warning about invalid escape sequence in some
regex strings. These warnings cause spack build to crash.
  • Loading branch information
edopao authored Nov 27, 2023
1 parent 6bea007 commit 1e486f2
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -228,8 +228,8 @@ def test_wrong_argument_type(cartesian_case, copy_program_def):
copy_program(inp, out, offset_provider={})

msgs = [
"- Expected argument `in_field` to be of type `Field\[\[IDim], float64\]`,"
" but got `Field\[\[JDim\], float64\]`.",
r"- Expected argument `in_field` to be of type `Field\[\[IDim], float64\]`,"
r" but got `Field\[\[JDim\], float64\]`.",
]
for msg in msgs:
assert re.search(msg, exc_info.value.__cause__.args[0]) is not None
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ def callable_type_info_cases():
[ts.TupleType(types=[float_type, field_type])],
{},
[
"Expected 1st argument to be of type `tuple\[bool, Field\[\[I\], float64\]\]`, but got `tuple\[float64, Field\[\[I\], float64\]\]`"
r"Expected 1st argument to be of type `tuple\[bool, Field\[\[I\], float64\]\]`, but got `tuple\[float64, Field\[\[I\], float64\]\]`"
],
ts.VoidType(),
),
Expand All @@ -308,7 +308,7 @@ def callable_type_info_cases():
[int_type],
{},
[
"Expected 1st argument to be of type `tuple\[bool, Field\[\[I\], float64\]\]`, but got `int64`"
r"Expected 1st argument to be of type `tuple\[bool, Field\[\[I\], float64\]\]`, but got `int64`"
],
ts.VoidType(),
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ def domain_format_3_program(in_field: gtx.Field[[IDim], float64]):
assert exc_info.match("Invalid call to `domain_format_3`")

assert (
re.search("Missing required keyword argument\(s\) `out`.", exc_info.value.__cause__.args[0])
re.search(r"Missing required keyword argument\(s\) `out`", exc_info.value.__cause__.args[0])
is not None
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,6 @@ def test_invalid_call_sig_program(invalid_call_sig_program_def):
# is not None
# )
assert (
re.search("Missing required keyword argument\(s\) `out`", exc_info.value.__cause__.args[0])
re.search(r"Missing required keyword argument\(s\) `out`", exc_info.value.__cause__.args[0])
is not None
)

0 comments on commit 1e486f2

Please sign in to comment.