Skip to content

Commit 09e0fc0

Browse files
committed
No longer running test_path_completion_complete_user unit test on Windows
1 parent f086960 commit 09e0fc0

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

tests/test_completion.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -321,10 +321,11 @@ def test_path_completion_doesnt_match_wildcards(cmd2_app, request):
321321
# Currently path completion doesn't accept wildcards, so will always return empty results
322322
assert cmd2_app.path_complete(text, line, begidx, endidx) == []
323323

324-
def test_path_completion_expand_user_dir(cmd2_app):
325-
# Get the current user. We can't use getpass.getuser() since
326-
# that doesn't work when running these tests on Windows in AppVeyor.
327-
user = os.path.basename(os.path.expanduser('~'))
324+
@pytest.mark.skipif(sys.platform == 'win32', reason="getpass.getuser() does not work on Windows in AppVeyor because "
325+
"no user name environment variables are set")
326+
def test_path_completion_complete_user(cmd2_app):
327+
import getpass
328+
user = getpass.getuser()
328329

329330
text = '~{}'.format(user)
330331
line = 'shell fake {}'.format(text)
@@ -335,7 +336,7 @@ def test_path_completion_expand_user_dir(cmd2_app):
335336
expected = text + os.path.sep
336337
assert expected in completions
337338

338-
def test_path_completion_user_expansion(cmd2_app):
339+
def test_path_completion_user_path_expansion(cmd2_app):
339340
# Run path with a tilde and a slash
340341
if sys.platform.startswith('win'):
341342
cmd = 'dir'

0 commit comments

Comments
 (0)