@@ -15,7 +15,7 @@ def equal_with_bash(prefix, ffc, fc, out=None):
1515 res_bash = set (fc (prefix ))
1616 retval = set (res ) == res_bash
1717 if out :
18- out .write ("equal_with_bash {} {}\n " .format (retval , res ))
18+ out .write ("equal_with_bash({}) {} {}\n " .format (prefix , retval , res ))
1919 if not retval :
2020 out .write (" python - bash: %s\n " % (set (res ) - res_bash ))
2121 out .write (" bash - python: %s\n " % (res_bash - set (res )))
@@ -91,14 +91,18 @@ def __call__(self, prefix, **kwargs):
9191
9292class TestArgComplete (object ):
9393 @pytest .mark .skipif ("sys.platform in ('win32', 'darwin')" )
94- def test_compare_with_compgen (self ):
94+ def test_compare_with_compgen (self , monkeypatch ):
9595 from _pytest ._argcomplete import FastFilesCompleter
9696
9797 ffc = FastFilesCompleter ()
9898 fc = FilesCompleter ()
99- for x in ["/" , "/d" , "/data" , "qqq" , "" ]:
99+ for x in ["/" , "/d" , "/data" , "qqq" ]:
100100 assert equal_with_bash (x , ffc , fc , out = sys .stdout )
101101
102+ # NOTE: do not use "" with cwd, since .coverage files might appear there.
103+ monkeypatch .chdir ("/home" )
104+ assert equal_with_bash ("" , ffc , fc , out = sys .stdout )
105+
102106 @pytest .mark .skipif ("sys.platform in ('win32', 'darwin')" )
103107 def test_remove_dir_prefix (self ):
104108 """this is not compatible with compgen but it is with bash itself:
0 commit comments