]> granicus.if.org Git - python/commitdiff
bpo-36919: make test_source_encoding.test_issue2301 implementation-independent (...
authorPavel Koneski <pavel.koneski@gmail.com>
Wed, 11 Sep 2019 13:57:33 +0000 (06:57 -0700)
committerJason R. Coombs <jaraco@jaraco.com>
Wed, 11 Sep 2019 13:57:32 +0000 (14:57 +0100)
* bpo-36919: make test_issue2301 implementation-independent

Lib/test/test_source_encoding.py
Misc/NEWS.d/next/Tests/2019-05-28-15-41-34.bpo-36919.-vGt_m.rst [new file with mode: 0644]

index 38734009c0085248de1b92841d787b79715415b6..a0bd741c36ac296453300929a47472b025bb2b8b 100644 (file)
@@ -31,7 +31,7 @@ class MiscSourceEncodingTest(unittest.TestCase):
         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()
 
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 (file)
index 0000000..9400bdd
--- /dev/null
@@ -0,0 +1,2 @@
+Make ``test_source_encoding.test_issue2301`` implementation independent. The
+test will work now for both CPython and IronPython.