summaryrefslogtreecommitdiff
path: root/tests/test_openpgp.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_openpgp.py')
-rw-r--r--tests/test_openpgp.py22
1 files changed, 17 insertions, 5 deletions
diff --git a/tests/test_openpgp.py b/tests/test_openpgp.py
index ce62add..995c9da 100644
--- a/tests/test_openpgp.py
+++ b/tests/test_openpgp.py
@@ -37,11 +37,7 @@ from tests.keydata import (
OTHER_PUBLIC_KEY, OTHER_PUBLIC_KEY_UID, OTHER_PUBLIC_KEY_SIG,
UNEXPIRE_SIG,
)
-from tests.testutil import hkp_server
-
-
-# workaround pyflakes
-hkp_server = hkp_server
+from tests.testutil import HKPServer
VALID_PUBLIC_KEY = PUBLIC_KEY + UID + PUBLIC_KEY_SIG
@@ -638,6 +634,22 @@ def test_recursive_manifest_loader_save_submanifest(tmp_path, privkey_env):
assert m2.openpgp_signature is None
+@pytest.fixture(scope='module')
+def global_hkp_server():
+ """A fixture that starts a single HKP server instance for tests"""
+ server = HKPServer()
+ server.start()
+ yield server
+ server.stop()
+
+
+@pytest.fixture
+def hkp_server(global_hkp_server):
+ """A fixture that resets the global HKP server with empty keys"""
+ global_hkp_server.keys.clear()
+ yield global_hkp_server
+
+
COMBINED_PUBLIC_KEYS = OTHER_VALID_PUBLIC_KEY + VALID_PUBLIC_KEY