Skip to content

Commit 0215257

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

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

Lib/test/test_readline.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,11 +147,15 @@ def test_init(self):
147147

148148
def test_auto_history_enabled(self):
149149
output = run_pty(self.auto_history_script.format(True))
150-
self.assertIn(b"History length: 1\r\n", output)
150+
# bpo-44949: Sometimes, the newline character is not written at the
151+
# end, so don't expect it in the output.
152+
self.assertIn(b"History length: 1", output)
151153

152154
def test_auto_history_disabled(self):
153155
output = run_pty(self.auto_history_script.format(False))
154-
self.assertIn(b"History length: 0\r\n", output)
156+
# bpo-44949: Sometimes, the newline character is not written at the
157+
# end, so don't expect it in the output.
158+
self.assertIn(b"History length: 0", output)
155159

156160
def test_nonascii(self):
157161
loc = locale.setlocale(locale.LC_CTYPE, None)
Lines changed: 2 additions & 0 deletions
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)