Skip to content

Commit d71c8e2

Browse files
committed
Fixup: make expected error robust across lark versions
1 parent e235738 commit d71c8e2

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

src/numba/openmp/tests/test_openmp.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1926,7 +1926,14 @@ def test_impl(nt):
19261926

19271927
with self.assertRaises(Exception) as raises:
19281928
test_impl(12)
1929-
self.assertIn("No terminal matches", str(raises.exception))
1929+
# Lark error text differs across versions: lexer failure ("No terminal matches")
1930+
# vs parser failure ("Unexpected token") for unsupported clauses like NOWAIT here.
1931+
err = str(raises.exception)
1932+
self.assertIn("nowait", err.lower())
1933+
self.assertTrue(
1934+
"No terminal matches" in err or "Unexpected token" in err,
1935+
err,
1936+
)
19301937

19311938
def test_parallel_double_num_threads(self):
19321939
@njit

0 commit comments

Comments
 (0)