@@ -143,6 +143,7 @@ def test_window_funcs(self):
143143 stdscr .idlok (1 )
144144 if hasattr (stdscr , 'immedok' ):
145145 stdscr .immedok (1 )
146+ stdscr .immedok (0 )
146147 stdscr .insch ('c' )
147148 stdscr .insdelln (1 )
148149 stdscr .insnstr ('abc' , 3 )
@@ -176,26 +177,27 @@ def test_window_funcs(self):
176177 stdscr .setscrreg (10 ,15 )
177178 win3 = stdscr .subwin (10 ,10 )
178179 win3 = stdscr .subwin (10 ,10 , 5 ,5 )
179- if hasattr (stdscr , 'syncok' ):
180+ if hasattr (stdscr , 'syncok' ) and not sys . platform . startswith ( "sunos" ) :
180181 stdscr .syncok (1 )
181182 stdscr .timeout (5 )
182183 stdscr .touchline (5 ,5 )
183184 stdscr .touchline (5 ,5 ,0 )
184185 stdscr .vline ('a' , 3 )
185186 stdscr .vline ('a' , 3 , curses .A_STANDOUT )
186- stdscr .chgat (5 , 2 , 3 , curses .A_BLINK )
187- stdscr .chgat (3 , curses .A_BOLD )
188- stdscr .chgat (5 , 8 , curses .A_UNDERLINE )
189- stdscr .chgat (curses .A_BLINK )
187+ if hasattr (stdscr , 'chgat' ):
188+ stdscr .chgat (5 , 2 , 3 , curses .A_BLINK )
189+ stdscr .chgat (3 , curses .A_BOLD )
190+ stdscr .chgat (5 , 8 , curses .A_UNDERLINE )
191+ stdscr .chgat (curses .A_BLINK )
190192 stdscr .refresh ()
191193
192194 stdscr .vline (1 ,1 , 'a' , 3 )
193195 stdscr .vline (1 ,1 , 'a' , 3 , curses .A_STANDOUT )
194196
195- if hasattr (curses , 'resize' ):
196- stdscr .resize ()
197- if hasattr (curses , 'enclose' ):
198- stdscr .enclose ()
197+ if hasattr (stdscr , 'resize' ):
198+ stdscr .resize (25 , 80 )
199+ if hasattr (stdscr , 'enclose' ):
200+ stdscr .enclose (10 , 10 )
199201
200202 self .assertRaises (ValueError , stdscr .getstr , - 400 )
201203 self .assertRaises (ValueError , stdscr .getstr , 2 , 3 , - 400 )
@@ -423,6 +425,8 @@ def test_issue21088(self):
423425
424426 def test_issue13051 (self ):
425427 stdscr = self .stdscr
428+ if not hasattr (stdscr , 'resize' ):
429+ raise unittest .SkipTest ('requires curses.window.resize' )
426430 box = curses .textpad .Textbox (stdscr , insert_mode = True )
427431 lines , cols = stdscr .getmaxyx ()
428432 stdscr .resize (lines - 2 , cols - 2 )
0 commit comments