From: Martin Panter Date: Thu, 14 Jul 2016 01:31:46 +0000 (+0000) Subject: Issue #27369: Don’t test error message detail that changed in Expat 2.2.0 X-Git-Tag: v2.7.13rc1~245 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=65e0d8ca651b3735c6fbb5d91190138d0a87d373;p=thirdparty%2FPython%2Fcpython.git Issue #27369: Don’t test error message detail that changed in Expat 2.2.0 --- diff --git a/Lib/test/test_pyexpat.py b/Lib/test/test_pyexpat.py index eba905801c25..72840bd31280 100644 --- a/Lib/test/test_pyexpat.py +++ b/Lib/test/test_pyexpat.py @@ -610,11 +610,9 @@ class MalformedInputText(unittest.TestCase): def test2(self): xml = "\r\n" parser = expat.ParserCreate() - try: + err_pattern = r'XML declaration not well-formed: line 1, column \d+' + with self.assertRaisesRegexp(expat.ExpatError, err_pattern): parser.Parse(xml, True) - self.fail() - except expat.ExpatError as e: - self.assertEqual(str(e), 'XML declaration not well-formed: line 1, column 14') class ForeignDTDTests(unittest.TestCase): """ diff --git a/Misc/NEWS b/Misc/NEWS index 162324205054..9ae2221c7db1 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -62,6 +62,12 @@ Documentation resulting links to use lowercase. Patch by Sean Rodman, test by Kaushik Nadikuditi. +Tests +----- + +- Issue #27369: In test_pyexpat, avoid testing an error message detail that + changed in Expat 2.2.0. + What's New in Python 2.7.12? ============================