Skip to content

Commit b04218b

Browse files
Add a test.
1 parent 423bf28 commit b04218b

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

Lib/test/test_curses.py

+10-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
from unittest.mock import MagicMock
99

1010
from test.support import (requires, verbose, SaveSignals, cpython_only,
11-
check_disallow_instantiation, MISSING_C_DOCSTRINGS)
11+
check_disallow_instantiation, MISSING_C_DOCSTRINGS,
12+
gc_collect)
1213
from test.support.import_helper import import_module
1314

1415
# Optionally test curses module. This currently requires that the
@@ -181,6 +182,14 @@ def test_create_windows(self):
181182
self.assertEqual(win3.getparyx(), (2, 1))
182183
self.assertEqual(win3.getmaxyx(), (6, 11))
183184

185+
def test_subwindows_references(self):
186+
win = curses.newwin(5, 10)
187+
win2 = win.subwin(3, 7)
188+
del win
189+
gc_collect()
190+
del win2
191+
gc_collect()
192+
184193
def test_move_cursor(self):
185194
stdscr = self.stdscr
186195
win = stdscr.subwin(10, 15, 2, 5)

0 commit comments

Comments
 (0)