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 797c8eb9ef)

Co-authored-by: Victor Stinner <vstinner@python.org>
This commit is contained in:
Miss Islington (bot) 2021-09-15 05:38:57 -07:00 committed by GitHub
parent f71b86e0ae
commit 4ce55cceb2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 1 deletions

View file

@ -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

View file

@ -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.