Skip to content

Commit

Permalink
Fix tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
ZeroIntensity committed Sep 29, 2024
1 parent db82f15 commit a79bd51
Showing 1 changed file with 15 additions and 9 deletions.
24 changes: 15 additions & 9 deletions Lib/test/test_curses.py
Original file line number Diff line number Diff line change
Expand Up @@ -1081,6 +1081,14 @@ def test_resize_term(self):
self.assertEqual(curses.LINES, lines)
self.assertEqual(curses.COLS, cols)

with self.assertRaises(OverflowError):
curses.resize_term(35000, 1)
with self.assertRaises(OverflowError):
curses.resize_term(1, 35000)
# GH-120378: Overflow failure in resizeterm() causes refresh to fail
tmp = curses.initscr()
tmp.erase()

@requires_curses_func('resizeterm')
def test_resizeterm(self):
curses.update_lines_cols()
Expand All @@ -1095,15 +1103,13 @@ def test_resizeterm(self):
self.assertEqual(curses.LINES, lines)
self.assertEqual(curses.COLS, cols)

for func in (curses.resizeterm, curses.resize_term):
with self.subTest(func=func):
with self.assertRaises(OverflowError):
func(35000, 1)
with self.assertRaises(OverflowError):
func(1, 35000)
# GH-120378: Overflow failure in resizeterm() causes refresh to fail
tmp = curses.initscr()
tmp.erase()
with self.assertRaises(OverflowError):
curses.resizeterm(35000, 1)
with self.assertRaises(OverflowError):
curses.resizeterm(1, 35000)
# GH-120378: Overflow failure in resizeterm() causes refresh to fail
tmp = curses.initscr()
tmp.erase()

def test_ungetch(self):
curses.ungetch(b'A')
Expand Down

0 comments on commit a79bd51

Please sign in to comment.