From 2a0714171d5712aafd5e0440c629f8d652560ee7 Mon Sep 17 00:00:00 2001 From: Pavel Koneski Date: Tue, 28 May 2019 15:22:48 -0700 Subject: [PATCH 1/2] bpo-36919: make test_issue2301 implementation-independent --- Lib/test/test_source_encoding.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lib/test/test_source_encoding.py b/Lib/test/test_source_encoding.py index 38734009c00852..a0bd741c36ac29 100644 --- a/Lib/test/test_source_encoding.py +++ b/Lib/test/test_source_encoding.py @@ -31,7 +31,7 @@ def test_issue2301(self): try: compile(b"# coding: cp932\nprint '\x94\x4e'", "dummy", "exec") except SyntaxError as v: - self.assertEqual(v.text, "print '\u5e74'\n") + self.assertEqual(v.text.rstrip('\n'), "print '\u5e74'") else: self.fail() From deb8c47dd30870b1382d3b9f53dbea5e6b0da70b Mon Sep 17 00:00:00 2001 From: Pavel Koneski Date: Tue, 28 May 2019 15:42:35 -0700 Subject: [PATCH 2/2] Add blurb --- Misc/NEWS.d/next/Tests/2019-05-28-15-41-34.bpo-36919.-vGt_m.rst | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 Misc/NEWS.d/next/Tests/2019-05-28-15-41-34.bpo-36919.-vGt_m.rst diff --git a/Misc/NEWS.d/next/Tests/2019-05-28-15-41-34.bpo-36919.-vGt_m.rst b/Misc/NEWS.d/next/Tests/2019-05-28-15-41-34.bpo-36919.-vGt_m.rst new file mode 100644 index 00000000000000..9400bdda5da189 --- /dev/null +++ b/Misc/NEWS.d/next/Tests/2019-05-28-15-41-34.bpo-36919.-vGt_m.rst @@ -0,0 +1,2 @@ +Make ``test_source_encoding.test_issue2301`` implementation independent. The +test will work now for both CPython and IronPython.