Skip to content

Commit ff63a70

Browse files
committed
Trying to fix Windows unit test when running on AppVeyor
1 parent 26a5f4d commit ff63a70

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

tests/test_completion.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
Released under MIT license, see LICENSE file
1010
"""
1111
import argparse
12-
import getpass
1312
import os
1413
import sys
1514

@@ -343,8 +342,9 @@ def test_path_completion_doesnt_match_wildcards(cmd2_app, request):
343342
assert cmd2_app.path_complete(text, line, begidx, endidx) == []
344343

345344
def test_path_completion_expand_user_dir(cmd2_app):
346-
# Get the current user
347-
user = getpass.getuser()
345+
# Get the current user. We can't use getpass.getuser() since
346+
# that doesn't work when running these tests on Windows in AppVeyor.
347+
user = os.path.basename(os.path.expanduser('~'))
348348

349349
text = '~{}'.format(user)
350350
line = 'shell fake {}'.format(text)

0 commit comments

Comments
 (0)