File tree Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -603,11 +603,9 @@ def test2(self):
603
603
# \xc2\x85 is UTF-8 encoded U+0085 (NEXT LINE)
604
604
xml = b"<?xml version\xc2 \x85 ='1.0'?>\r \n "
605
605
parser = expat .ParserCreate ()
606
- try :
606
+ err_pattern = r'XML declaration not well-formed: line 1, column \d+'
607
+ with self .assertRaisesRegex (expat .ExpatError , err_pattern ):
607
608
parser .Parse (xml , True )
608
- self .fail ()
609
- except expat .ExpatError as e :
610
- self .assertEqual (str (e ), 'XML declaration not well-formed: line 1, column 14' )
611
609
612
610
class ErrorMessageTest (unittest .TestCase ):
613
611
def test_codes (self ):
Original file line number Diff line number Diff line change @@ -27,6 +27,9 @@ Library
27
27
Tests
28
28
-----
29
29
30
+ - Issue #27369: In test_pyexpat, avoid testing an error message detail that
31
+ changed in Expat 2.2.0.
32
+
30
33
- Issue #25940: Changed test_ssl and test_httplib to use
31
34
self-signed.pythontest.net. This avoids relying on svn.python.org, which
32
35
recently changed root certificate.
You can’t perform that action at this time.
0 commit comments