Skip to content

Commit

Permalink
Make simplifications after dropping python3.6
Browse files Browse the repository at this point in the history
Signed-off-by: Martin Vrachev <mvrachev@vmware.com>
  • Loading branch information
MVrachev committed Jan 27, 2022
1 parent 195e1d2 commit 63ff108
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 15 deletions.
3 changes: 0 additions & 3 deletions tests/test_hash.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,6 @@ def _is_supported_combination(library, algorithm):
if algorithm in blake_algos:
if library == 'pyca_crypto':
return False
# hashlib does not support blake2* if < 3.6
elif library == 'hashlib' and sys.version_info[:2] < (3, 6):
return False
return True


Expand Down
13 changes: 1 addition & 12 deletions tests/test_signer.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,7 @@
import securesystemslib.formats
import securesystemslib.keys as KEYS
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
from securesystemslib.signer import Signature, SSlibSigner


class TestSSlibSigner(unittest.TestCase):
Expand Down

0 comments on commit 63ff108

Please sign in to comment.