Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b7b5d35

Browse files
committed
Issue #27369: Merge test_pyexpat from 3.3 into 3.4
2 parents 8cf1496 + d27a7c1 commit b7b5d35

2 files changed

Lines changed: 8 additions & 4 deletions

File tree

Lib/test/test_pyexpat.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -662,11 +662,9 @@ def test2(self):
662662
# \xc2\x85 is UTF-8 encoded U+0085 (NEXT LINE)
663663
xml = b"<?xml version\xc2\x85='1.0'?>\r\n"
664664
parser = expat.ParserCreate()
665-
try:
665+
err_pattern = r'XML declaration not well-formed: line 1, column \d+'
666+
with self.assertRaisesRegex(expat.ExpatError, err_pattern):
666667
parser.Parse(xml, True)
667-
self.fail()
668-
except expat.ExpatError as e:
669-
self.assertEqual(str(e), 'XML declaration not well-formed: line 1, column 14')
670668

671669
class ErrorMessageTest(unittest.TestCase):
672670
def test_codes(self):

Misc/NEWS

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@ Core and Builtins
1313
Library
1414
-------
1515

16+
Tests
17+
-----
18+
19+
- Issue #27369: In test_pyexpat, avoid testing an error message detail that
20+
changed in Expat 2.2.0.
21+
1622

1723
What's New in Python 3.4.5?
1824
===========================

0 commit comments

Comments
 (0)