@@ -51,6 +51,12 @@ def wrapped(self, *args, **kwargs):
5151
5252term = os .environ .get ('TERM' )
5353SHORT_MAX = 0x7fff
54+ DEFAULT_PAIR_CONTENTS = [
55+ (curses .COLOR_WHITE , curses .COLOR_BLACK ),
56+ (0 , 0 ),
57+ (- 1 , - 1 ),
58+ (15 , 0 ), # for xterm-256color (15 is for BRIGHT WHITE)
59+ ]
5460
5561# If newterm was supported we could use it instead of initscr and not exit
5662@unittest .skipIf (not term or term == 'unknown' ,
@@ -751,7 +757,6 @@ def test_output_options(self):
751757 curses .nl (False )
752758 curses .nl ()
753759
754-
755760 def test_input_options (self ):
756761 stdscr = self .stdscr
757762
@@ -944,8 +949,7 @@ def get_pair_limit(self):
944949 @requires_colors
945950 def test_pair_content (self ):
946951 if not hasattr (curses , 'use_default_colors' ):
947- self .assertEqual (curses .pair_content (0 ),
948- (curses .COLOR_WHITE , curses .COLOR_BLACK ))
952+ self .assertIn (curses .pair_content (0 ), DEFAULT_PAIR_CONTENTS )
949953 curses .pair_content (0 )
950954 maxpair = self .get_pair_limit () - 1
951955 if maxpair > 0 :
@@ -996,7 +1000,7 @@ def test_use_default_colors(self):
9961000 except curses .error :
9971001 self .skipTest ('cannot change color (use_default_colors() failed)' )
9981002 self .assertEqual (curses .pair_content (0 ), (- 1 , - 1 ))
999- self .assertIn (old , [( curses . COLOR_WHITE , curses . COLOR_BLACK ), ( - 1 , - 1 ), ( 0 , 0 )] )
1003+ self .assertIn (old , DEFAULT_PAIR_CONTENTS )
10001004
10011005 def test_keyname (self ):
10021006 # TODO: key_name()
0 commit comments