Skip to content

Commit 35253e2

Browse files
committed
Fixing GPG home location for tests
1 parent f3af616 commit 35253e2

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

tests/conftest.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import os
44
import pytest
55
import shutil
6+
import subprocess
67

78

89
from pathlib import Path, PurePosixPath
@@ -83,9 +84,12 @@ def should_populate(request) -> bool:
8384
should_populate: bool = request.config.option.populate_expected
8485
return should_populate
8586

87+
def find_gpg_home():
88+
return subprocess.run(['gpgconf', '-L', 'homedir'], check=True, capture_output=True).stdout.decode().strip()
89+
8690
@pytest.fixture
8791
def pgp_signer():
88-
return PgpSigner(Path(os.environ.get('GNUPGHOME', Path.home() / '.gnupg')),
92+
return PgpSigner(Path(os.environ.get('GNUPGHOME', find_gpg_home())),
8993
os.environ['PGP_KEY_NAME'],
9094
os.environ['PGP_KEY_PASSWD'])
9195

0 commit comments

Comments
 (0)