From: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> Date: Wed, 15 Sep 2021 12:38:57 +0000 (-0700) Subject: bpo-45195: Fix test_readline.test_nonascii() (GH-28329) (GH-28334) X-Git-Tag: v3.9.8~167 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=4ce55cceb2901c564962f724448a9ced00c8a738;p=thirdparty%2FPython%2Fcpython.git bpo-45195: Fix test_readline.test_nonascii() (GH-28329) (GH-28334) Fix test_readline.test_nonascii(): sometimes, the newline character is not written at the end, so don't expect it in the output. (cherry picked from commit 797c8eb9ef511f0c25f10a453b35c4d2fe383c30) Co-authored-by: Victor Stinner --- diff --git a/Lib/test/test_readline.py b/Lib/test/test_readline.py index 7898abb7a61d..6bde9e3c5980 100644 --- a/Lib/test/test_readline.py +++ b/Lib/test/test_readline.py @@ -236,7 +236,9 @@ print("history", ascii(readline.get_history_item(1))) self.assertIn(b"matches ['t\\xebnt', 't\\xebxt']\r\n", output) expected = br"'[\xefnserted]|t\xebxt[after]'" self.assertIn(b"result " + expected + b"\r\n", output) - self.assertIn(b"history " + expected + b"\r\n", output) + # bpo-45195: Sometimes, the newline character is not written at the + # end, so don't expect it in the output. + self.assertIn(b"history " + expected, output) # We have 2 reasons to skip this test: # - readline: history size was added in 6.0 diff --git a/Misc/NEWS.d/next/Tests/2021-09-14-13-16-18.bpo-45195.EyQR1G.rst b/Misc/NEWS.d/next/Tests/2021-09-14-13-16-18.bpo-45195.EyQR1G.rst new file mode 100644 index 000000000000..16a1f4440483 --- /dev/null +++ b/Misc/NEWS.d/next/Tests/2021-09-14-13-16-18.bpo-45195.EyQR1G.rst @@ -0,0 +1,3 @@ +Fix test_readline.test_nonascii(): sometimes, the newline character is not +written at the end, so don't expect it in the output. Patch by Victor +Stinner.