summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Bruhin <me@the-compiler.org>2021-01-27 19:48:52 +0100
committerFlorian Bruhin <me@the-compiler.org>2021-01-27 19:48:52 +0100
commit217711f200bb4bfe839b694916653b06bc76ec5d (patch)
treecdb2d8cfa9a79fc65c1f85db79aeba0f19c9d075
parent3a9770e2d718755f948c6b72fa8e368a5414ac9a (diff)
downloadqutebrowser-217711f200bb4bfe839b694916653b06bc76ec5d.tar.gz
qutebrowser-217711f200bb4bfe839b694916653b06bc76ec5d.zip
tests: Fix ~ completion test on Windows
-rw-r--r--tests/unit/completion/test_models.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/tests/unit/completion/test_models.py b/tests/unit/completion/test_models.py
index ce5aebbe5..8a6b24557 100644
--- a/tests/unit/completion/test_models.py
+++ b/tests/unit/completion/test_models.py
@@ -423,7 +423,11 @@ def test_filesystem_completion(qtmodeltester, config_stub, info,
expected_1 = file_1.as_uri()
expected_2 = file_2.as_uri()
elif method == 'home':
- monkeypatch.setenv('HOME', str(local_files_path))
+ homedir = str(local_files_path)
+ monkeypatch.setenv('HOME', homedir) # POSIX
+ monkeypatch.setenv('USERPROFILE', homedir) # Windows
+ assert os.path.expanduser('~') == homedir
+
base = '~'
expected_1 = os.path.join('~', 'file1.txt')
expected_2 = os.path.join('~', 'file2.txt')