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

(cherry picked from commit f41c16bf51)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
This commit is contained in:
Miss Islington (bot) 2022-04-25 22:57:57 -07:00 committed by GitHub
parent 79712c9d2e
commit 3e219d3123
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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)