Skip to content

Commit 2ad91ec

Browse files
committed
test/ant: avoid complete-ant-cmd.pl interference with ANT_ARGS
1 parent 0df93b0 commit 2ad91ec

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

test/t/test_ant.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import pytest
22

3+
from conftest import assert_bash_exec
4+
35

46
@pytest.mark.bashcomp(ignore_env=r"^\+ANT_ARGS=")
57
class TestAnt:
@@ -18,8 +20,15 @@ def test_3(self, completion):
1820
@pytest.mark.complete(
1921
"ant ", cwd="ant", env=dict(ANT_ARGS="'-f named-build.xml'")
2022
)
21-
def test_4(self, completion):
22-
assert completion == "named-build"
23+
def test_4(self, bash, completion):
24+
output = assert_bash_exec(bash, "complete -p ant", want_output=True)
25+
if "complete-ant-cmd.pl" in output:
26+
# Some versions of complete-ant-cmd.pl don't treat ANT_ARGS right;
27+
# in those cases we get the correct completion produced by _ant
28+
# plus whatever complete-ant-cmd.pl was able to get from build.xml
29+
assert "named-build" in completion
30+
else:
31+
assert completion == "named-build"
2332

2433
@pytest.mark.complete("ant -l ")
2534
def test_5(self, completion):

0 commit comments

Comments
 (0)