Skip to content
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
+ restore tests
  • Loading branch information
skirpichev committed Aug 24, 2024
commit 510594f7bc5385dc2b64c31adeceb0b0b0114fd9
8 changes: 5 additions & 3 deletions Lib/test/test_pyrepl/test_pyrepl.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import curses
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this line is failing on windows. why is the except curses.error: pass needed anyway?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Else this fails

Traceback (most recent call last):
  File "/home/runner/work/cpython/cpython/Lib/test/test_pyrepl/test_pyrepl.py", line 522, in test_basic
    self.assertIs(type(get_line_buffer()), str)
                       ~~~~~~~~~~~~~~~^^
  File "/home/runner/work/cpython/cpython/Lib/_pyrepl/readline.py", line 483, in get_line_buffer
    return self.get_reader().get_unicode()
           ~~~~~~~~~~~~~~~^^
  File "/home/runner/work/cpython/cpython/Lib/_pyrepl/readline.py", line 358, in get_reader
    console = Console(self.f_in, self.f_out, encoding=ENCODING)
  File "/home/runner/work/cpython/cpython/Lib/_pyrepl/unix_console.py", line 154, in __init__
    curses.setupterm(term or None, self.output_fd)
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
_curses.error: setupterm: could not find terminfo database`

(e.g. here: https://github.com/python/cpython/actions/runs/10536985217/job/29197815100)

import io
import itertools
import os
Expand Down Expand Up @@ -517,9 +518,10 @@ def test_basic(self):
self.assertEqual(output, "1+1")
self.assertEqual(clean_screen(reader.screen), "1+1")

# skip, if readline module is not available
import_module('readline')
self.assertIs(type(get_line_buffer()), str)
try:
self.assertIs(type(get_line_buffer()), str)
except curses.error:
pass

def test_multiline_edit(self):
events = itertools.chain(
Expand Down