Skip to content

Commit 1415a98

Browse files
committed
improve tests
1 parent 7f86edd commit 1415a98

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

Lib/test/test_syntax.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3508,7 +3508,7 @@ def test_ifexp_body_stmt_else_stmt(self):
35083508
def test_double_ampersand(self):
35093509
self._check_error(
35103510
"a && b",
3511-
"Maybe you meant 'and' or '&' instead of '&&'?",
3511+
r"Maybe you meant 'and' or '&' instead of '&&'\?",
35123512
lineno=1,
35133513
end_lineno=1,
35143514
offset=3,
@@ -3522,11 +3522,19 @@ def test_double_ampersand(self):
35223522
offset=5,
35233523
end_offset=6,
35243524
)
3525+
self._check_error(
3526+
"(a &\n & b)",
3527+
"invalid syntax",
3528+
lineno=2,
3529+
end_lineno=2,
3530+
offset=5,
3531+
end_offset=6,
3532+
)
35253533

35263534
def test_double_pipe(self):
35273535
self._check_error(
35283536
"a || b",
3529-
"Maybe you meant 'or' or '|' instead of '||'?",
3537+
r"Maybe you meant 'or' or '|' instead of '||'\?",
35303538
lineno=1,
35313539
end_lineno=1,
35323540
offset=3,

0 commit comments

Comments
 (0)