summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorAndrew Kuchling <amk@amk.ca>2013-06-15 19:10:08 (GMT)
committerAndrew Kuchling <amk@amk.ca>2013-06-15 19:10:08 (GMT)
commit8a2a902f88ce2ab8d0e27a189a65e71aed6dd670 (patch)
tree7dd014ac5438dac22fed5e5fc84752fa527c34c9 /Lib
parentf15a59fdf3e6b99b1859df97713fe4d1870fa936 (diff)
parent53e5ea7951b674ed223ae8dd3bb2da595d685ec5 (diff)
downloadcpython-8a2a902f88ce2ab8d0e27a189a65e71aed6dd670.zip
cpython-8a2a902f88ce2ab8d0e27a189a65e71aed6dd670.tar.gz
cpython-8a2a902f88ce2ab8d0e27a189a65e71aed6dd670.tar.bz2
Merge with 3.3
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_curses.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/Lib/test/test_curses.py b/Lib/test/test_curses.py
index e959622..76812b7 100644
--- a/Lib/test/test_curses.py
+++ b/Lib/test/test_curses.py
@@ -252,6 +252,18 @@ def test_userptr_without_set(stdscr):
except curses.panel.error:
pass
+def test_userptr_memory_leak(stdscr):
+ w = curses.newwin(10, 10)
+ p = curses.panel.new_panel(w)
+ obj = object()
+ nrefs = sys.getrefcount(obj)
+ for i in range(100):
+ p.set_userptr(obj)
+
+ p.set_userptr(None)
+ if sys.getrefcount(obj) != nrefs:
+ raise RuntimeError("set_userptr leaked references")
+
def test_resize_term(stdscr):
if hasattr(curses, 'resizeterm'):
lines, cols = curses.LINES, curses.COLS
@@ -317,6 +329,7 @@ def main(stdscr):
module_funcs(stdscr)
window_funcs(stdscr)
test_userptr_without_set(stdscr)
+ test_userptr_memory_leak(stdscr)
test_resize_term(stdscr)
test_issue6243(stdscr)
test_unget_wch(stdscr)