Hi,<br><br><div class="gmail_quote">On Tue, Sep 6, 2011 at 11:08 AM, victor.stinner <span dir="ltr"><<a href="mailto:python-checkins@python.org">python-checkins@python.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<a href="http://hg.python.org/cpython/rev/786668a4fb6b" target="_blank">http://hg.python.org/cpython/rev/786668a4fb6b</a><br>
changeset: 72301:786668a4fb6b<br>
user: Victor Stinner <<a href="mailto:vstinner@wyplay.com">vstinner@wyplay.com</a>><br>
date: Tue Sep 06 10:08:28 2011 +0200<br>
summary:<br>
Issue #12567: Fix curses.unget_wch() tests<br>
<br>
Skip the test if the function is missing. Use U+0061 (a) instead of U+00E9 (é)<br>
because U+00E9 raises a _curses.error('unget_wch() returned ERR') on some<br>
buildbots. It's maybe because of the locale encoding.<br>
<br>
files:<br>
Lib/test/test_curses.py | 6 ++++--<br>
1 files changed, 4 insertions(+), 2 deletions(-)<br>
<br>
<br>
diff --git a/Lib/test/test_curses.py b/Lib/test/test_curses.py<br>
--- a/Lib/test/test_curses.py<br>
+++ b/Lib/test/test_curses.py<br>
@@ -265,14 +265,16 @@<br>
stdscr.getkey()<br>
<br>
def test_unget_wch(stdscr):<br>
- ch = '\xe9'<br>
+ if not hasattr(curses, 'unget_wch'):<br>
+ return<br></blockquote><div><br>This should be a skip, not a bare return.<br> </div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
+ ch = 'a'<br>
curses.unget_wch(ch)<br>
read = stdscr.get_wch()<br>
read = chr(read)<br>
if read != ch:<br>
raise AssertionError("%r != %r" % (read, ch))<br></blockquote><div><br>Why not just assertEqual?<br> </div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<br>
- ch = ord('\xe9')<br>
+ ch = ord('a')<br>
curses.unget_wch(ch)<br>
read = stdscr.get_wch()<br>
if read != ch:<br>
<font color="#888888"><br>
</font><br></blockquote><div><br>Best Regards,<br>Ezio Melotti <br></div></div><br>