From 65e0d8ca651b3735c6fbb5d91190138d0a87d373 Mon Sep 17 00:00:00 2001 From: Martin Panter Date: Thu, 14 Jul 2016 01:31:46 +0000 Subject: [PATCH] =?utf8?q?Issue=20#27369:=20Don=E2=80=99t=20test=20error?= =?utf8?q?=20message=20detail=20that=20changed=20in=20Expat=202.2.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- Lib/test/test_pyexpat.py | 6 ++---- Misc/NEWS | 6 ++++++ 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/Lib/test/test_pyexpat.py b/Lib/test/test_pyexpat.py index eba905801c..72840bd312 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 1623242050..9ae2221c7d 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? ============================ -- 2.50.1