Skip to content

Commit a093e4e

Browse files
committed
fix rich tests on windows shell complete
1 parent 60f9f51 commit a093e4e

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

tests/shellcompletion/__init__.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -290,12 +290,19 @@ def run_rich_option_completion(self, rich_output_expected: bool):
290290
self.assertIn("[/yellow]", completions)
291291
elif rich_output_expected:
292292
# \x1b[0m and \x1b[m are the same
293-
self.assertIn("\x1b[1mimport path\x1b[", completions)
294293
if self.shell not in ["powershell", "pwsh"]:
295-
# on powershell the helps cycle through when you tab - so only the first one is listed
296294
self.assertIn("\x1b[7mcommands\x1b[", completions)
297295
self.assertIn("\x1b[4;33mcommands\x1b[", completions)
298296
self.assertIn("\x1b[1mname\x1b[", completions)
297+
else:
298+
# on powershell the helps cycle through when you tab - so only one is listed
299+
self.assertTrue(
300+
"\x1b[1mimport path\x1b[" in completions
301+
or "\x1b[7mcommands\x1b[" in completions
302+
or "\x1b[4;33mcommands\x1b[" in completions
303+
or "\x1b[1mname\x1b[" in completions
304+
)
305+
299306
else:
300307
self.assertNotIn("\x1b[7mcommands\x1b[", completions)
301308
self.assertNotIn("\x1b[4;33mcommands\x1b[", completions)

0 commit comments

Comments
 (0)