blob: 62fa908d8ca92ab23c98ca0efc3ebb252a98816f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
From 059be065e28551d4b029c8d525fafdaea3df4a3d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
Date: Tue, 18 Feb 2025 11:10:21 +0100
Subject: [PATCH 1/2] test: Fix expected exception message for PyPy3.11
Fix the regex in `test_parser.py::PythonParserTest::test_not_python`
to account for the possibility of code being wrapped in double quotes
rather than single quotes, to fix the test on PyPy3.11.
---
tests/test_parser.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tests/test_parser.py b/tests/test_parser.py
index 2ab30853..a9a247ff 100644
--- a/tests/test_parser.py
+++ b/tests/test_parser.py
@@ -123,7 +123,7 @@ class PythonParserTest(PythonParserTestBase):
)
])
def test_not_python(self, text: str) -> None:
- msg = r"Couldn't parse '<code>' as Python source: '.*' at line \d+"
+ msg = r"Couldn't parse '<code>' as Python source: ['\"].*['\"] at line \d+"
with pytest.raises(NotPython, match=msg):
_ = self.parse_text(text)
|