Skip to content

Commit 82c7ac4

Browse files
committed
Fix unit test on VSTS Hosted Linux agents
1 parent d60ed53 commit 82c7ac4

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

tests/test_cmd2.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1426,10 +1426,16 @@ def test_help_with_no_docstring(capsys):
14261426
@pytest.mark.skipif(sys.platform.startswith('win'),
14271427
reason="utils.which function only used on Mac and Linux")
14281428
def test_which_editor_good():
1429+
import platform
14291430
editor = 'vi'
14301431
path = utils.which(editor)
1431-
# Assert that the vi editor was found because it should exist on all Mac and Linux systems
1432-
assert path
1432+
1433+
if 'azure' in platform.release().lower():
1434+
# vi doesn't exist on VSTS Hosted Linux agents
1435+
assert not path
1436+
else:
1437+
# Assert that the vi editor was found because it should exist on all Mac and Linux systems
1438+
assert path
14331439

14341440
@pytest.mark.skipif(sys.platform.startswith('win'),
14351441
reason="utils.which function only used on Mac and Linux")

0 commit comments

Comments
 (0)