Skip to content

Commit 4e333e9

Browse files
committed
Fix new key lookup
Contrary to popular belief, python does not automatically expand `~` in pathlib.PosixPath objects.
1 parent 4961f69 commit 4e333e9

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

tests/conftest.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
LOG_FORMATTER.converter = time.gmtime
3636
SETTINGS_DIR = Path.home() / '.psij'
3737
KEY_FILE = SETTINGS_DIR / '.key'
38+
NEW_KEY_FILE = SETTINGS_DIR / 'key'
3839
ID_FILE = SETTINGS_DIR / '.id'
3940
RESULTS_ROOT = Path('tests') / 'results'
4041

@@ -257,8 +258,8 @@ def _cache(file_path, fn):
257258

258259

259260
def _get_key(config):
260-
if Path('~/.psij/key').exists():
261-
with open('~/.psij/key') as f:
261+
if Path(NEW_KEY_FILE).exists():
262+
with open(NEW_KEY_FILE) as f:
262263
return f.read().strip()
263264
else:
264265
# use legacy if needed

0 commit comments

Comments
 (0)