From 99ce001fc9576dcc70e038cebd6606548dfb5744 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jelmer=20Vernoo=C4=B3?= Date: Sat, 16 Nov 2024 12:31:31 +0000 Subject: [PATCH] Check whether GPG is actually available rather than inferring from OS --- tests/compat/test_porcelain.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/tests/compat/test_porcelain.py b/tests/compat/test_porcelain.py index aed8dfca6..1fb49ade4 100644 --- a/tests/compat/test_porcelain.py +++ b/tests/compat/test_porcelain.py @@ -21,8 +21,6 @@ """Compatibility tests for dulwich.porcelain.""" import os -import platform -import sys from unittest import skipIf from dulwich import porcelain @@ -31,15 +29,17 @@ from ..test_porcelain import PorcelainGpgTestCase from .utils import CompatTestCase, run_git_or_fail +try: + import gpgme +except ImportError: + gpgme = None + @skipIf( - platform.python_implementation() == "PyPy" or sys.platform == "win32", - "gpgme not easily available or supported on Windows and PyPy", + gpgme is None, + "gpgme not available, skipping tests that require GPG signing", ) class TagCreateSignTestCase(PorcelainGpgTestCase, CompatTestCase): - def setUp(self): - super().setUp() - def test_sign(self): # Test that dulwich signatures can be verified by CGit c1, c2, c3 = build_commit_graph(