diff --git a/test/test_ui.py b/test/test_ui.py index 61e3ff33e..ab8cc289d 100644 --- a/test/test_ui.py +++ b/test/test_ui.py @@ -1123,12 +1123,18 @@ class CompletionTest(_common.TestCase, TestHelper): config['pluginpath'] = [_common.PLUGINPATH] config['plugins'] = ['test'] - # Tests run in bash + # Do not load any other bash completion scripts on the system. + env = dict(os.environ) + env['BASH_COMPLETION_DIR'] = os.devnull + env['BASH_COMPLETION_COMPAT_DIR'] = os.devnull + + # Open a `bash` process to run the tests in. We'll pipe in bash + # commands via stdin. cmd = os.environ.get('BEETS_TEST_SHELL', '/bin/bash --norc').split() if not has_program(cmd[0]): self.skipTest(u'bash not available') tester = subprocess.Popen(cmd, stdin=subprocess.PIPE, - stdout=subprocess.PIPE) + stdout=subprocess.PIPE, env=env) # Load bash_completion library. for path in commands.BASH_COMPLETION_PATHS: