Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions tests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import io
import json
import os
import shutil
import subprocess
import sys
import tempfile
Expand Down Expand Up @@ -501,9 +502,10 @@ def test_completion_aliases_and_module_entry(self):
for command in main.COMMANDS:
self.assertIn(":" + command, script)
self.assertIn("--only-tasks", script)
result = subprocess.run(
["/bin/" + shell, "-n"], input=script, text=True, capture_output=True
)
binary = shutil.which(shell)
if binary is None: # e.g. no zsh on a Linux CI runner: only the text is checked
continue
result = subprocess.run([binary, "-n"], input=script, text=True, capture_output=True)
self.assertEqual(result.returncode, 0, result.stderr)
if shell == "bash":
probe = (
Expand All @@ -516,7 +518,7 @@ def test_completion_aliases_and_module_entry(self):
+ script
+ "\nwords=(harness2 run --on); CURRENT=3; _harness2_complete"
)
result = subprocess.run(["/bin/" + shell], input=probe, text=True, capture_output=True)
result = subprocess.run([binary], input=probe, text=True, capture_output=True)
self.assertEqual(result.returncode, 0, result.stderr)
self.assertIn("--only-tasks", result.stdout)
for executable, command in main.ALIASES.items():
Expand Down
Loading