Skip to content

Commit

Permalink
Mark test as only for PyCrypto and PyCryptodome
Browse files Browse the repository at this point in the history
  • Loading branch information
blag committed Dec 19, 2019
1 parent 4154b9d commit e4b92e0
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion tests/test_jws.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
import json
import warnings

import pytest

from jose import jwk
from jose import jws
from jose.constants import ALGORITHMS
from jose.exceptions import JWSError

import pytest
try:
from Crypto.PublicKey import RSA as PyCryptoRSA
from jose.backends.pycrypto_backend import RSAKey as PyCryptoRSAKey
except ImportError:
PyCryptoRSA = PyCryptoRSAKey = None


@pytest.fixture
Expand Down Expand Up @@ -292,6 +298,9 @@ def test_wrong_key(self, payload):
with pytest.raises(JWSError):
jws.verify(token, rsa_public_key, ALGORITHMS.HS256)

@pytest.mark.pycrypto
@pytest.mark.pycryptodome
@pytest.mark.skipif(None in (PyCryptoRSA, PyCryptoRSAKey), reason="Pycrypto/dome backend not available")
def test_private_verify_raises_warning(self, payload):
token = jws.sign(payload, rsa_private_key, algorithm='RS256')

Expand Down

0 comments on commit e4b92e0

Please sign in to comment.