gh-91914: Fix test_curses on non-UTF-8 locale (GH-91919)

This commit is contained in:
Serhiy Storchaka 2022-04-26 07:59:56 +03:00 committed by GitHub
parent 36306cf786
commit f41c16bf51
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 1 deletions

View File

@ -268,7 +268,12 @@ class TestCurses(unittest.TestCase):
stdscr.echochar(b'A')
stdscr.echochar(65)
with self.assertRaises((UnicodeEncodeError, OverflowError)):
stdscr.echochar('\u20ac')
# Unicode is not fully supported yet, but at least it does
# not crash.
# It is supposed to fail because either the character is
# not encodable with the current encoding, or it is encoded to
# a multibyte sequence.
stdscr.echochar('\u0114')
stdscr.echochar('A', curses.A_BOLD)
self.assertIs(stdscr.is_wintouched(), False)