equal
deleted
inserted
replaced
1 This patch comes from upstream: |
|
2 |
|
3 http://bugs.python.org/issue27369 |
|
4 |
|
5 --- a/Lib/test/test_pyexpat.py |
|
6 +++ b/Lib/test/test_pyexpat.py |
|
7 @@ -662,11 +662,9 @@ class MalformedInputTest(unittest.TestCa |
|
8 # \xc2\x85 is UTF-8 encoded U+0085 (NEXT LINE) |
|
9 xml = b"<?xml version\xc2\x85='1.0'?>\r\n" |
|
10 parser = expat.ParserCreate() |
|
11 - try: |
|
12 + err_pattern = r'XML declaration not well-formed: line 1, column \d+' |
|
13 + with self.assertRaisesRegex(expat.ExpatError, err_pattern): |
|
14 parser.Parse(xml, True) |
|
15 - self.fail() |
|
16 - except expat.ExpatError as e: |
|
17 - self.assertEqual(str(e), 'XML declaration not well-formed: line 1, column 14') |
|
18 |
|
19 class ErrorMessageTest(unittest.TestCase): |
|
20 def test_codes(self): |
|