Skip to content

Commit db2d82e

Browse files
committed
Fix test_completion by setting WHATEVER
1 parent 594f2b3 commit db2d82e

File tree

3 files changed

+11
-0
lines changed

3 files changed

+11
-0
lines changed

beets/ui/commands.py

+4
Original file line numberDiff line numberDiff line change
@@ -2433,6 +2433,9 @@ def print_completion(*args):
24332433
b"/opt/local/share/bash-completion/bash_completion",
24342434
# Homebrew (before bash-completion2)
24352435
b"/usr/local/etc/bash_completion",
2436+
b"/opt/homebrew/etc/profile.d/",
2437+
b"/opt/homebrew/etc/profile.d/bash_completion",
2438+
b"/opt/homebrew/etc/profile.d/bash_completion.sh",
24362439
]
24372440

24382441

@@ -2443,6 +2446,7 @@ def completion_script(commands):
24432446
completion data for.
24442447
"""
24452448
base_script = os.path.join(os.path.dirname(__file__), "completion_base.sh")
2449+
print(base_script)
24462450
with open(base_script) as base_script:
24472451
yield base_script.read()
24482452

beets/ui/completion_base.sh

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#!/usr/bin/env bash
12
# This file is part of beets.
23
# Copyright (c) 2014, Thomas Scholtes.
34
#

test/test_ui.py

+6
Original file line numberDiff line numberDiff line change
@@ -1407,14 +1407,20 @@ def test_completion(self):
14071407
# Open a `bash` process to run the tests in. We'll pipe in bash
14081408
# commands via stdin.
14091409
cmd = os.environ.get("BEETS_TEST_SHELL", "/bin/bash --norc").split()
1410+
print("cmd is:")
1411+
print(cmd)
1412+
print()
14101413
if not has_program(cmd[0]):
14111414
self.skipTest("bash not available")
14121415
tester = subprocess.Popen(
14131416
cmd, stdin=subprocess.PIPE, stdout=subprocess.PIPE, env=env
14141417
)
1418+
print(tester)
14151419

1420+
print(commands.BASH_COMPLETION_PATHS)
14161421
# Load bash_completion library.
14171422
for path in commands.BASH_COMPLETION_PATHS:
1423+
print(path)
14181424
if os.path.exists(syspath(path)):
14191425
bash_completion = path
14201426
break

0 commit comments

Comments
 (0)