Skip to content

[3.9] bpo-44949: Fix test_readline auto history tests (GH-27813) #27822

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 19, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions Lib/test/test_readline.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,11 +147,15 @@ def test_init(self):

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

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

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