Skip to content

Commit

Permalink
bpo-44949: Fix test_readline auto history tests (GH-27813) (GH-31118)
Browse files Browse the repository at this point in the history
(cherry picked from commit 6fb62b4)

Co-authored-by: Victor Stinner <vstinner@python.org>
  • Loading branch information
miss-islington and vstinner committed Feb 17, 2022
1 parent 8a84aef commit b1bc04d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 6 additions & 2 deletions Lib/test/test_readline.py
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
@@ -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.

0 comments on commit b1bc04d

Please sign in to comment.