]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-45195: Fix test_readline.test_nonascii() (GH-28329)
authorVictor Stinner <vstinner@python.org>
Tue, 14 Sep 2021 15:38:04 +0000 (17:38 +0200)
committerGitHub <noreply@github.com>
Tue, 14 Sep 2021 15:38:04 +0000 (17:38 +0200)
Fix test_readline.test_nonascii(): sometimes, the newline character
is not written at the end, so don't expect it in the output.

Lib/test/test_readline.py
Misc/NEWS.d/next/Tests/2021-09-14-13-16-18.bpo-45195.EyQR1G.rst [new file with mode: 0644]

index e8fb8d2f9cc603ac450b319b738849daf44b7c74..59dbef903800530e2b91f904a951174b249cda4d 100644 (file)
@@ -255,7 +255,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 (file)
index 0000000..16a1f44
--- /dev/null
@@ -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.