@@ -81,8 +81,6 @@ def bash_repl(command="bash"):
8181def zsh_repl (command = "zsh" ):
8282 sh = _repl_sh (command , ["--no-rcs" , "-V" ], non_printable_insert = "%(!..)" )
8383 sh .run_command ("autoload compinit; compinit -u" )
84- # Require two tabs to print all options (some tests rely on this).
85- sh .run_command ("setopt BASH_AUTO_LIST" )
8684 return sh
8785
8886
@@ -1262,6 +1260,9 @@ def setUp(self):
12621260 path = ":" .join ([os .path .join (BASE_DIR , "scripts" ), TEST_DIR , "$PATH" ])
12631261 sh .run_command ("export PATH={0}" .format (path ))
12641262 sh .run_command ("export PYTHONPATH={0}" .format (BASE_DIR ))
1263+ if self .repl_provider == bash_repl :
1264+ # Disable the "python" module provided by bash-completion
1265+ sh .run_command ("complete -r python python2 python3" )
12651266 output = sh .run_command (self .install_cmd )
12661267 self .assertEqual (output , "" )
12671268 # Register a dummy completion with an external argcomplete script
@@ -1316,24 +1317,18 @@ class TestZsh(TestBashZshBase, unittest.TestCase):
13161317 "test_parse_special_characters_dollar" ,
13171318 "test_comp_point" , # FIXME
13181319 "test_completion_environment" , # FIXME
1320+ "test_continuation" , # FIXME
1321+ "test_wordbreak_chars" , # FIXME
13191322 ]
13201323
13211324 def repl_provider (self ):
13221325 return zsh_repl ()
13231326
13241327
1325- class TestBashZshGlobalBase (TestBashZshBase ):
1328+ @unittest .skipIf (BASH_MAJOR_VERSION < 4 , "complete -D not supported" )
1329+ class TestBashGlobal (TestBash ):
13261330 install_cmd = 'eval "$(activate-global-python-argcomplete --dest=-)"'
13271331
1328- def test_redirection_completion (self ):
1329- with TempDir (prefix = "test_dir_py" , dir = "." ):
1330- self .sh .run_command ("cd " + os .getcwd ())
1331- self .sh .run_command ("echo failure > ./foo.txt" )
1332- self .sh .run_command ("echo success > ./foo.\t " )
1333- with open ("foo.txt" ) as f :
1334- msg = f .read ()
1335- self .assertEqual (msg , "success\n " )
1336-
13371332 def test_python_completion (self ):
13381333 self .sh .run_command ("cd " + TEST_DIR )
13391334 self .assertEqual (self .sh .run_command ("python3 ./prog basic f\t " ), "foo\r \n " )
@@ -1373,6 +1368,9 @@ def _test_console_script(self, package=False, wheel=False):
13731368 command = "pip install {} --target ." .format (test_package )
13741369 if not wheel :
13751370 command += " --no-binary :all:"
1371+ if sys .platform == "darwin" :
1372+ # Work around https://stackoverflow.com/questions/24257803
1373+ command += ' --install-option="--prefix="'
13761374 install_output = self .sh .run_command (command )
13771375 self .assertEqual (self .sh .run_command ("echo $?" ), "0\r \n " , install_output )
13781376 command = "test-module"
@@ -1381,32 +1379,27 @@ def _test_console_script(self, package=False, wheel=False):
13811379 command += " a\t "
13821380 self .assertEqual (self .sh .run_command (command ), "arg\r \n " )
13831381
1382+ @unittest .skipIf (os .uname ()[0 ] == "Darwin" , "Skip test that fails on MacOS" )
13841383 def test_console_script_module (self ):
13851384 """Test completing a console_script for a module."""
13861385 self ._test_console_script ()
13871386
1387+ @unittest .skipIf (os .uname ()[0 ] == "Darwin" , "Skip test that fails on MacOS" )
13881388 def test_console_script_package (self ):
13891389 """Test completing a console_script for a package."""
13901390 self ._test_console_script (package = True )
13911391
1392+ @unittest .skipIf (os .uname ()[0 ] == "Darwin" , "Skip test that fails on MacOS" )
13921393 def test_console_script_module_wheel (self ):
13931394 """Test completing a console_script for a module from a wheel."""
13941395 self ._test_console_script (wheel = True )
13951396
1397+ @unittest .skipIf (os .uname ()[0 ] == "Darwin" , "Skip test that fails on MacOS" )
13961398 def test_console_script_package_wheel (self ):
13971399 """Test completing a console_script for a package from a wheel."""
13981400 self ._test_console_script (package = True , wheel = True )
13991401
14001402
1401- @unittest .skipIf (BASH_MAJOR_VERSION < 4 , "complete -D not supported" )
1402- class TestBashGlobal (TestBash , TestBashZshGlobalBase ):
1403- pass
1404-
1405-
1406- class TestZshGlobal (TestZsh , TestBashZshGlobalBase ):
1407- pass
1408-
1409-
14101403class Shell :
14111404 def __init__ (self , shell ):
14121405 self .child = pexpect .spawn (shell , encoding = "utf-8" )
0 commit comments