--- contrib/python/prompt-toolkit/py3/tests/test_completion.py (index) +++ contrib/python/prompt-toolkit/py3/tests/test_completion.py (working tree) @@ -197,7 +197,8 @@ def test_pathcompleter_does_not_expanduser_by_default(): assert [] == completions -def test_pathcompleter_can_expanduser(): +def test_pathcompleter_can_expanduser(monkeypatch): + monkeypatch.setenv('HOME', '/tmp') completer = PathCompleter(expanduser=True) doc_text = "~" doc = Document(doc_text, len(doc_text))