Skip to content

Commit f5f3974

Browse files
authored
Merge pull request #927 from python-cmd2/which_editor_test
Fix unit test which made incorrect assumption about vi editor
2 parents 33aa802 + c9b8bb1 commit f5f3974

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

tests/test_cmd2.py

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1224,16 +1224,11 @@ def test_help_with_no_docstring(capsys):
12241224
@pytest.mark.skipif(sys.platform.startswith('win'),
12251225
reason="utils.which function only used on Mac and Linux")
12261226
def test_which_editor_good():
1227-
import platform
1228-
editor = 'vi'
1227+
editor = cmd2.Cmd.DEFAULT_EDITOR
12291228
path = utils.which(editor)
12301229

1231-
if 'azure' in platform.release().lower():
1232-
# vi doesn't exist on VSTS Hosted Linux agents
1233-
assert not path
1234-
else:
1235-
# Assert that the vi editor was found because it should exist on all Mac and Linux systems
1236-
assert path
1230+
# Assert that the editor was found because some editor should exist on all Mac and Linux systems
1231+
assert path
12371232

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

0 commit comments

Comments
 (0)