Skip to content

Commit fc6ad05

Browse files
bpo-44949: Fix test_readline auto history tests (GH-27813)
(cherry picked from commit 6fb62b42f4db56ed5efe0ca4c1059049276c1083) Co-authored-by: Victor Stinner <[email protected]>
1 parent ad16f93 commit fc6ad05

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

Lib/test/test_readline.py

+6-2
Original file line numberDiff line numberDiff line change
@@ -156,11 +156,15 @@ def test_init(self):
156156

157157
def test_auto_history_enabled(self):
158158
output = run_pty(self.auto_history_script.format(True))
159-
self.assertIn(b"History length: 1\r\n", output)
159+
# bpo-44949: Sometimes, the newline character is not written at the
160+
# end, so don't expect it in the output.
161+
self.assertIn(b"History length: 1", output)
160162

161163
def test_auto_history_disabled(self):
162164
output = run_pty(self.auto_history_script.format(False))
163-
self.assertIn(b"History length: 0\r\n", output)
165+
# bpo-44949: Sometimes, the newline character is not written at the
166+
# end, so don't expect it in the output.
167+
self.assertIn(b"History length: 0", output)
164168

165169
def test_nonascii(self):
166170
loc = locale.setlocale(locale.LC_CTYPE, None)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Fix auto history tests of test_readline: sometimes, the newline character is
2+
not written at the end, so don't expect it in the output.

0 commit comments

Comments
 (0)