summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_curses.py
diff options
context:
space:
mode:
authorAnthony Baxter <anthonybaxter@gmail.com>2006-04-06 07:12:39 (GMT)
committerAnthony Baxter <anthonybaxter@gmail.com>2006-04-06 07:12:39 (GMT)
commite94e3b440f0619585701970c22e538f9059a38bd (patch)
tree20c02ceb056057da0818d8dc5084a4dfd4b2d22b /Lib/test/test_curses.py
parentd9da722d85ebf573ebd497f396e05d6c697ebca0 (diff)
downloadcpython-e94e3b440f0619585701970c22e538f9059a38bd.zip
cpython-e94e3b440f0619585701970c22e538f9059a38bd.tar.gz
cpython-e94e3b440f0619585701970c22e538f9059a38bd.tar.bz2
In some environments (under screen, in a chroot) curses doesn't support
mouse events. This makes the test fail. Catch that case and don't run the tests. Should make the debian/ubuntu buildbots that run in a chroot work again. Will backport to release24-maint.
Diffstat (limited to 'Lib/test/test_curses.py')
-rw-r--r--Lib/test/test_curses.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/Lib/test/test_curses.py b/Lib/test/test_curses.py
index 126251e..dc2f20b 100644
--- a/Lib/test/test_curses.py
+++ b/Lib/test/test_curses.py
@@ -204,11 +204,13 @@ def module_funcs(stdscr):
curses.has_key(13)
if hasattr(curses, 'getmouse'):
- curses.mousemask(curses.BUTTON1_PRESSED)
- curses.mouseinterval(10)
- # just verify these don't cause errors
- m = curses.getmouse()
- curses.ungetmouse(*m)
+ (availmask, oldmask) = curses.mousemask(curses.BUTTON1_PRESSED)
+ # availmask indicates that mouse stuff not available.
+ if availmask != 0:
+ curses.mouseinterval(10)
+ # just verify these don't cause errors
+ m = curses.getmouse()
+ curses.ungetmouse(*m)
def unit_tests():
from curses import ascii