@@ -51,6 +51,12 @@ def wrapped(self, *args, **kwargs):
51
51
52
52
term = os .environ .get ('TERM' )
53
53
SHORT_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
+ ]
54
60
55
61
# If newterm was supported we could use it instead of initscr and not exit
56
62
@unittest .skipIf (not term or term == 'unknown' ,
@@ -751,7 +757,6 @@ def test_output_options(self):
751
757
curses .nl (False )
752
758
curses .nl ()
753
759
754
-
755
760
def test_input_options (self ):
756
761
stdscr = self .stdscr
757
762
@@ -944,8 +949,7 @@ def get_pair_limit(self):
944
949
@requires_colors
945
950
def test_pair_content (self ):
946
951
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 )
949
953
curses .pair_content (0 )
950
954
maxpair = self .get_pair_limit () - 1
951
955
if maxpair > 0 :
@@ -996,7 +1000,7 @@ def test_use_default_colors(self):
996
1000
except curses .error :
997
1001
self .skipTest ('cannot change color (use_default_colors() failed)' )
998
1002
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 )
1000
1004
1001
1005
def test_keyname (self ):
1002
1006
# TODO: key_name()
0 commit comments