Skip to content

Commit

Permalink
Skip test_signer on Python2.7
Browse files Browse the repository at this point in the history
Signed-off-by: Martin Vrachev <[email protected]>
  • Loading branch information
MVrachev committed Feb 23, 2021
1 parent 1e2185c commit 2bc36c9
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion tests/test_signer.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,27 @@

"""Test cases for "signer.py". """

import sys
import unittest

import unittest
import securesystemslib.formats
import securesystemslib.keys as KEYS
from securesystemslib.signer import Signature, SSlibSigner
from securesystemslib.exceptions import FormatError, UnsupportedAlgorithmError

# TODO: Remove case handling when fully dropping support for versions < 3.6
IS_PY_VERSION_SUPPORTED = sys.version_info >= (3, 6)

# Use setUpModule to tell unittest runner to skip this test module gracefully.
def setUpModule():
if not IS_PY_VERSION_SUPPORTED:
raise unittest.SkipTest("requires Python 3.6 or higher")

# Since setUpModule is called after imports we need to import conditionally.
if IS_PY_VERSION_SUPPORTED:
from securesystemslib.signer import Signature, SSlibSigner


class TestSSlibSigner(unittest.TestCase):

@classmethod
Expand Down

0 comments on commit 2bc36c9

Please sign in to comment.