Skip to content

Commit c61bab6

Browse files
committed
Fix this test
1 parent c9c97f7 commit c61bab6

1 file changed

Lines changed: 8 additions & 13 deletions

File tree

Lib/test/test_pyrepl/test_fancycompleter.py

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -121,19 +121,14 @@ def test_complete_global_colored(self):
121121
self.assertEqual(compl.global_matches('nothing'), [])
122122

123123
def test_complete_global_colored_exception(self):
124-
compl = Completer({'tryme': ValueError()}, ColorConfig)
125-
if sys.version_info >= (3, 6):
126-
self.assertEqual(compl.global_matches('try'), [
127-
'\x1b[000;00m\x1b[37mtry:\x1b[00m',
128-
'\x1b[001;00m\x1b[31;01mtryme\x1b[00m',
129-
' '
130-
])
131-
else:
132-
self.assertEqual(compl.global_matches('try'), [
133-
'\x1b[000;00m\x1b[37mtry\x1b[00m',
134-
'\x1b[001;00m\x1b[31;01mtryme\x1b[00m',
135-
' '
136-
])
124+
compl = Completer({'tryme': 42}, ColorConfig)
125+
N0 = f"\x1b[000;00m"
126+
N1 = f"\x1b[001;00m"
127+
self.assertEqual(compl.global_matches('try'), [
128+
f'{N0}{ANSIColors.GREY}try:{ANSIColors.RESET}',
129+
f'{N1}{ANSIColors.BOLD_YELLOW}tryme{ANSIColors.RESET}',
130+
' '
131+
])
137132

138133
def test_complete_with_indexer(self):
139134
compl = Completer({'lst': [None, 2, 3]}, ConfigForTest)

0 commit comments

Comments
 (0)