[Python-checkins] cpython: Issue #12567: Fix curses.unget_wch() tests

Ezio Melotti ezio.melotti at gmail.com
Thu Sep 8 11:11:52 CEST 2011


Hi,

On Tue, Sep 6, 2011 at 11:08 AM, victor.stinner
<python-checkins at python.org>wrote:

> http://hg.python.org/cpython/rev/786668a4fb6b
> changeset:   72301:786668a4fb6b
> user:        Victor Stinner <vstinner at wyplay.com>
> date:        Tue Sep 06 10:08:28 2011 +0200
> summary:
>  Issue #12567: Fix curses.unget_wch() tests
>
> Skip the test if the function is missing. Use U+0061 (a) instead of U+00E9
> (é)
> because U+00E9 raises a _curses.error('unget_wch() returned ERR') on some
> buildbots. It's maybe because of the locale encoding.
>
> files:
>  Lib/test/test_curses.py |  6 ++++--
>  1 files changed, 4 insertions(+), 2 deletions(-)
>
>
> diff --git a/Lib/test/test_curses.py b/Lib/test/test_curses.py
> --- a/Lib/test/test_curses.py
> +++ b/Lib/test/test_curses.py
> @@ -265,14 +265,16 @@
>     stdscr.getkey()
>
>  def test_unget_wch(stdscr):
> -    ch = '\xe9'
> +    if not hasattr(curses, 'unget_wch'):
> +        return
>

This should be a skip, not a bare return.


> +    ch = 'a'
>     curses.unget_wch(ch)
>     read = stdscr.get_wch()
>     read = chr(read)
>     if read != ch:
>         raise AssertionError("%r != %r" % (read, ch))
>

Why not just assertEqual?


>
> -    ch = ord('\xe9')
> +    ch = ord('a')
>     curses.unget_wch(ch)
>     read = stdscr.get_wch()
>     if read != ch:
>
>
>
Best Regards,
Ezio Melotti
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-checkins/attachments/20110908/5d5e68fd/attachment.html>


More information about the Python-checkins mailing list