python: Fix skipping tests if running with GnuPG < 2.1.12.
authorJustus Winter <justus@g10code.com>
Thu, 30 Mar 2017 12:58:29 +0000 (14:58 +0200)
committerJustus Winter <justus@g10code.com>
Thu, 30 Mar 2017 13:06:10 +0000 (15:06 +0200)
* final.py: Import 'support.py' for the side-effect of checking the
GnuPG version.
* t-data.py: Likewise.
* t-protocol-assuan.py: Likewise.
* t-wrapper.py: Likewise.
* t-callbacks.py: Avoid warning about 'support' being unused.
* t-edit.py: Likewise.
* t-encrypt-sym.py: Likewise.
* t-file-name.py: Likewise.
* t-idiomatic.py: Likewise.
* t-sig-notation.py: Likewise.
* t-trustlist.py: Likewise.
* t-verify.py: Likewise.
* t-wait.py: Likewise.
* t-keylist-from-data.py: Trim unused imports.

GnuPG-bug-id: 3008
Fixes-commit: 348da58fe0c3656e6177c98fef6b4c4331326c8e
Signed-off-by: Justus Winter <justus@g10code.com>
14 files changed:
lang/python/tests/final.py
lang/python/tests/t-callbacks.py
lang/python/tests/t-data.py
lang/python/tests/t-edit.py
lang/python/tests/t-encrypt-sym.py
lang/python/tests/t-file-name.py
lang/python/tests/t-idiomatic.py
lang/python/tests/t-keylist-from-data.py
lang/python/tests/t-protocol-assuan.py
lang/python/tests/t-sig-notation.py
lang/python/tests/t-trustlist.py
lang/python/tests/t-verify.py
lang/python/tests/t-wait.py
lang/python/tests/t-wrapper.py

index 8e7ab33..65375cb 100755 (executable)
@@ -22,6 +22,8 @@ del absolute_import, print_function, unicode_literals
 
 import os
 import subprocess
+import support
+_ = support # to appease pyflakes.
 
 subprocess.check_call([os.path.join(os.getenv('top_srcdir'),
                                     "tests", "start-stop-agent"), "--stop"])
index 94cf11e..9a70cda 100755 (executable)
@@ -23,8 +23,7 @@ del absolute_import, print_function, unicode_literals
 import os
 import gpg
 import support
-
-support.assert_gpg_version()
+_ = support # to appease pyflakes.
 
 c = gpg.Context()
 c.set_pinentry_mode(gpg.constants.PINENTRY_MODE_LOOPBACK)
index d1facd4..3301319 100755 (executable)
@@ -24,6 +24,8 @@ import io
 import os
 import tempfile
 import gpg
+import support
+_ = support # to appease pyflakes.
 
 data = gpg.Data('Hello world!')
 assert data.read() == b'Hello world!'
index ffc3296..b1075a9 100755 (executable)
@@ -25,8 +25,7 @@ import sys
 import os
 import gpg
 import support
-
-support.assert_gpg_version()
+_ = support # to appease pyflakes.
 
 class KeyEditor(object):
     def __init__(self):
index 8ee9cd6..8299293 100755 (executable)
@@ -23,8 +23,7 @@ del absolute_import, print_function, unicode_literals
 import os
 import gpg
 import support
-
-support.assert_gpg_version()
+_ = support # to appease pyflakes.
 
 for passphrase in ("abc", b"abc"):
     c = gpg.Context()
index aab5680..32fe84a 100755 (executable)
@@ -23,6 +23,7 @@ del absolute_import, print_function, unicode_literals
 import os
 import gpg
 import support
+_ = support # to appease pyflakes.
 
 testname = "abcde12345"
 
index 826bc23..b7ae4eb 100755 (executable)
@@ -26,6 +26,7 @@ import os
 import tempfile
 import gpg
 import support
+_ = support # to appease pyflakes.
 
 # Both Context and Data can be used as context manager:
 with gpg.Context() as c, gpg.Data() as d:
index 6a26267..6503eb7 100755 (executable)
@@ -20,8 +20,6 @@
 from __future__ import absolute_import, print_function, unicode_literals
 del absolute_import, print_function, unicode_literals
 
-import os
-import sys
 import gpg
 import support
 
index 27b28c7..8da5035 100755 (executable)
@@ -21,6 +21,8 @@ from __future__ import absolute_import, print_function, unicode_literals
 del absolute_import, print_function, unicode_literals
 
 import gpg
+import support
+_ = support # to appease pyflakes.
 
 with gpg.Context(protocol=gpg.constants.protocol.ASSUAN) as c:
     # Do nothing.
index 2277497..bc8da2e 100755 (executable)
@@ -23,6 +23,7 @@ del absolute_import, print_function, unicode_literals
 import os
 import gpg
 import support
+_ = support # to appease pyflakes.
 
 expected_notations = {
     "laughing@me": ("Just Squeeze Me", gpg.constants.sig.notation.HUMAN_READABLE),
index 8586596..89524bb 100755 (executable)
@@ -22,6 +22,7 @@ del absolute_import, print_function, unicode_literals
 
 import gpg
 import support
+_ = support # to appease pyflakes.
 
 c = gpg.Context()
 
index 0347638..320dae6 100755 (executable)
@@ -24,6 +24,7 @@ import sys
 import os
 import gpg
 import support
+_ = support # to appease pyflakes.
 
 test_text1 = b"Just GNU it!\n"
 test_text1f= b"Just GNU it?\n"
index 0c403fa..3101301 100755 (executable)
@@ -23,6 +23,7 @@ del absolute_import, print_function, unicode_literals
 import time
 import gpg
 import support
+_ = support # to appease pyflakes.
 
 c = gpg.Context()
 c.set_armor(True)
index 79f047f..08a320d 100755 (executable)
@@ -18,6 +18,8 @@
 # License along with this program; if not, see <http://www.gnu.org/licenses/>.
 
 import gpg
+import support
+_ = support # to appease pyflakes.
 
 d0 = gpg.Data()
 d0.seek # trigger on-demand-wrapping