Skip to content

Commit f17586a

Browse files
chore: Fix CI (#351)
1 parent 3ed84f7 commit f17586a

16 files changed

+67
-66
lines changed

decrypt_oracle/setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
def read(*args):
1212
"""Read complete file contents."""
13-
return open(os.path.join(HERE, *args)).read()
13+
return open(os.path.join(HERE, *args)).read() # pylint: disable=consider-using-with
1414

1515

1616
def get_version():

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
def read(*args):
1212
"""Reads complete file contents."""
13-
return open(os.path.join(HERE, *args)).read()
13+
return open(os.path.join(HERE, *args)).read() # pylint: disable=consider-using-with
1414

1515

1616
def get_version():

src/aws_encryption_sdk/internal/utils/streams.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ class TeeStream(ObjectProxy):
4444
:type tee: io.BaseIO
4545
"""
4646

47-
__tee = None # Prime ObjectProxy's attributes to allow setting in init.
47+
# Prime ObjectProxy's attributes to allow setting in init.
48+
__tee = None # pylint: disable=unused-private-member
4849

4950
def __init__(self, wrapped, tee):
5051
"""Creates the local tee stream."""

test/integration/test_kat_commitment.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ def _file_root():
5050
base_dir = os.path.join(root_dir, "test", "resources")
5151
file_path = os.path.join(base_dir, FILE_NAME)
5252

53-
test_str = open(file_path, "r").read()
53+
test_str = open(file_path, "r").read() # pylint: disable=consider-using-with
5454
test_json = json.loads(test_str)
5555
kat_tests = test_json["tests"]
5656

test/unit/test_caches_crypto_cache_entry.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
}
3333

3434

35-
@pytest.yield_fixture
35+
@pytest.fixture
3636
def patch_time(mocker):
3737
mocker.patch.object(aws_encryption_sdk.caches.time, "time")
3838

test/unit/test_caches_local.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ def test_try_to_evict_one_entry_entry_valid():
132132
cache._lre_deque.appendleft.assert_called_once_with(mock_reference)
133133

134134

135-
@pytest.yield_fixture
135+
@pytest.fixture
136136
def patch_try_to_evict_one_entry(mocker):
137137
mocker.patch.object(LocalCryptoMaterialsCache, "_try_to_evict_one_entry")
138138
yield LocalCryptoMaterialsCache._try_to_evict_one_entry
@@ -165,7 +165,7 @@ def test_prune(patch_try_to_evict_one_entry):
165165
patch_try_to_evict_one_entry.assert_has_calls((call(), call()))
166166

167167

168-
@pytest.yield_fixture
168+
@pytest.fixture
169169
def patch_prune(mocker):
170170
mocker.patch.object(LocalCryptoMaterialsCache, "_prune")
171171
yield LocalCryptoMaterialsCache._prune
@@ -183,19 +183,19 @@ def test_add_value_to_cache(patch_prune):
183183
patch_prune.assert_called_once_with()
184184

185185

186-
@pytest.yield_fixture
186+
@pytest.fixture
187187
def patch_try_to_evict_some_entries(mocker):
188188
mocker.patch.object(LocalCryptoMaterialsCache, "_try_to_evict_some_entries")
189189
yield LocalCryptoMaterialsCache._try_to_evict_some_entries
190190

191191

192-
@pytest.yield_fixture
192+
@pytest.fixture
193193
def patch_add_value_to_cache(mocker):
194194
mocker.patch.object(LocalCryptoMaterialsCache, "_add_value_to_cache")
195195
yield LocalCryptoMaterialsCache._add_value_to_cache
196196

197197

198-
@pytest.yield_fixture
198+
@pytest.fixture
199199
def patch_crypto_cache_entry(mocker):
200200
mocker.patch.object(aws_encryption_sdk.caches.local, "CryptoMaterialsCacheEntry")
201201
yield aws_encryption_sdk.caches.local.CryptoMaterialsCacheEntry
@@ -252,7 +252,7 @@ def test_remove_success():
252252
assert sentinel.value not in cache._cache
253253

254254

255-
@pytest.yield_fixture
255+
@pytest.fixture
256256
def patch_remove(mocker):
257257
mocker.patch.object(LocalCryptoMaterialsCache, "remove")
258258
yield LocalCryptoMaterialsCache.remove
@@ -291,7 +291,7 @@ def test_get_single_entry_cache_hit_valid():
291291
assert test is mock_entry
292292

293293

294-
@pytest.yield_fixture
294+
@pytest.fixture
295295
def patch_get_single_entry(mocker):
296296
mocker.patch.object(LocalCryptoMaterialsCache, "_get_single_entry")
297297
yield LocalCryptoMaterialsCache._get_single_entry

test/unit/test_crypto_authentication_signer.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,37 +24,37 @@
2424
pytestmark = [pytest.mark.unit, pytest.mark.local]
2525

2626

27-
@pytest.yield_fixture
27+
@pytest.fixture
2828
def patch_default_backend(mocker):
2929
mocker.patch.object(aws_encryption_sdk.internal.crypto.authentication, "default_backend")
3030
yield aws_encryption_sdk.internal.crypto.authentication.default_backend
3131

3232

33-
@pytest.yield_fixture
33+
@pytest.fixture
3434
def patch_serialization(mocker):
3535
mocker.patch.object(aws_encryption_sdk.internal.crypto.authentication, "serialization")
3636
yield aws_encryption_sdk.internal.crypto.authentication.serialization
3737

3838

39-
@pytest.yield_fixture
39+
@pytest.fixture
4040
def patch_ecc_encode_compressed_point(mocker):
4141
mocker.patch.object(aws_encryption_sdk.internal.crypto.authentication, "_ecc_encode_compressed_point")
4242
yield aws_encryption_sdk.internal.crypto.authentication._ecc_encode_compressed_point
4343

4444

45-
@pytest.yield_fixture
45+
@pytest.fixture
4646
def patch_ecc_static_length_signature(mocker):
4747
mocker.patch.object(aws_encryption_sdk.internal.crypto.authentication, "_ecc_static_length_signature")
4848
yield aws_encryption_sdk.internal.crypto.authentication._ecc_static_length_signature
4949

5050

51-
@pytest.yield_fixture
51+
@pytest.fixture
5252
def patch_base64(mocker):
5353
mocker.patch.object(aws_encryption_sdk.internal.crypto.authentication, "base64")
5454
yield aws_encryption_sdk.internal.crypto.authentication.base64
5555

5656

57-
@pytest.yield_fixture
57+
@pytest.fixture
5858
def patch_build_hasher(mocker):
5959
mocker.patch.object(Signer, "_build_hasher")
6060
yield Signer._build_hasher

test/unit/test_crypto_authentication_verifier.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,49 +24,49 @@
2424
pytestmark = [pytest.mark.unit, pytest.mark.local]
2525

2626

27-
@pytest.yield_fixture
27+
@pytest.fixture
2828
def patch_default_backend(mocker):
2929
mocker.patch.object(aws_encryption_sdk.internal.crypto.authentication, "default_backend")
3030
yield aws_encryption_sdk.internal.crypto.authentication.default_backend
3131

3232

33-
@pytest.yield_fixture
33+
@pytest.fixture
3434
def patch_serialization(mocker):
3535
mocker.patch.object(aws_encryption_sdk.internal.crypto.authentication, "serialization")
3636
yield aws_encryption_sdk.internal.crypto.authentication.serialization
3737

3838

39-
@pytest.yield_fixture
39+
@pytest.fixture
4040
def patch_ecc_public_numbers_from_compressed_point(mocker):
4141
mocker.patch.object(aws_encryption_sdk.internal.crypto.authentication, "_ecc_public_numbers_from_compressed_point")
4242
yield aws_encryption_sdk.internal.crypto.authentication._ecc_public_numbers_from_compressed_point
4343

4444

45-
@pytest.yield_fixture
45+
@pytest.fixture
4646
def patch_ec(mocker):
4747
mocker.patch.object(aws_encryption_sdk.internal.crypto.authentication, "ec")
4848
yield aws_encryption_sdk.internal.crypto.authentication.ec
4949

5050

51-
@pytest.yield_fixture
51+
@pytest.fixture
5252
def patch_prehashed(mocker):
5353
mocker.patch.object(aws_encryption_sdk.internal.crypto.authentication, "Prehashed")
5454
yield aws_encryption_sdk.internal.crypto.authentication.Prehashed
5555

5656

57-
@pytest.yield_fixture
57+
@pytest.fixture
5858
def patch_base64(mocker):
5959
mocker.patch.object(aws_encryption_sdk.internal.crypto.authentication, "base64")
6060
yield aws_encryption_sdk.internal.crypto.authentication.base64
6161

6262

63-
@pytest.yield_fixture
63+
@pytest.fixture
6464
def patch_build_hasher(mocker):
6565
mocker.patch.object(Verifier, "_build_hasher")
6666
yield Verifier._build_hasher
6767

6868

69-
@pytest.yield_fixture
69+
@pytest.fixture
7070
def patch_set_signature_type(mocker):
7171
mocker.patch.object(Verifier, "_set_signature_type")
7272
yield Verifier._set_signature_type

test/unit/test_crypto_data_keys.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,18 +15,18 @@
1515
from mock import MagicMock, sentinel
1616
from pytest_mock import mocker # noqa pylint: disable=unused-import
1717

18-
import aws_encryption_sdk.internal.crypto.data_keys as data_keys
18+
from aws_encryption_sdk.internal.crypto import data_keys
1919

2020
pytestmark = [pytest.mark.unit, pytest.mark.local]
2121

2222

23-
@pytest.yield_fixture
23+
@pytest.fixture
2424
def patch_default_backend(mocker):
2525
mocker.patch.object(data_keys, "default_backend")
2626
yield data_keys.default_backend
2727

2828

29-
@pytest.yield_fixture
29+
@pytest.fixture
3030
def patch_struct(mocker):
3131
mocker.patch.object(data_keys, "struct")
3232
yield data_keys.struct

test/unit/test_crypto_elliptic_curve.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -36,55 +36,55 @@
3636
pytestmark = [pytest.mark.unit, pytest.mark.local]
3737

3838

39-
@pytest.yield_fixture
39+
@pytest.fixture
4040
def patch_default_backend(mocker):
4141
mocker.patch.object(aws_encryption_sdk.internal.crypto.elliptic_curve, "default_backend")
4242
yield aws_encryption_sdk.internal.crypto.elliptic_curve.default_backend
4343

4444

45-
@pytest.yield_fixture
45+
@pytest.fixture
4646
def patch_ec(mocker):
4747
mocker.patch.object(aws_encryption_sdk.internal.crypto.elliptic_curve, "ec")
4848
yield aws_encryption_sdk.internal.crypto.elliptic_curve.ec
4949

5050

51-
@pytest.yield_fixture
51+
@pytest.fixture
5252
def patch_pow(mocker):
5353
mocker.patch.object(aws_encryption_sdk.internal.crypto.elliptic_curve, "pow")
5454
yield aws_encryption_sdk.internal.crypto.elliptic_curve.pow
5555

5656

57-
@pytest.yield_fixture
57+
@pytest.fixture
5858
def patch_encode_dss_signature(mocker):
5959
mocker.patch.object(aws_encryption_sdk.internal.crypto.elliptic_curve, "encode_dss_signature")
6060
yield aws_encryption_sdk.internal.crypto.elliptic_curve.encode_dss_signature
6161

6262

63-
@pytest.yield_fixture
63+
@pytest.fixture
6464
def patch_decode_dss_signature(mocker):
6565
mocker.patch.object(aws_encryption_sdk.internal.crypto.elliptic_curve, "decode_dss_signature")
6666
yield aws_encryption_sdk.internal.crypto.elliptic_curve.decode_dss_signature
6767

6868

69-
@pytest.yield_fixture
69+
@pytest.fixture
7070
def patch_ecc_decode_compressed_point(mocker):
7171
mocker.patch.object(aws_encryption_sdk.internal.crypto.elliptic_curve, "_ecc_decode_compressed_point")
7272
yield aws_encryption_sdk.internal.crypto.elliptic_curve._ecc_decode_compressed_point
7373

7474

75-
@pytest.yield_fixture
75+
@pytest.fixture
7676
def patch_verify_interface(mocker):
7777
mocker.patch.object(aws_encryption_sdk.internal.crypto.elliptic_curve, "verify_interface")
7878
yield aws_encryption_sdk.internal.crypto.elliptic_curve.verify_interface
7979

8080

81-
@pytest.yield_fixture
81+
@pytest.fixture
8282
def patch_ecc_curve_parameters(mocker):
8383
mocker.patch.object(aws_encryption_sdk.internal.crypto.elliptic_curve, "_ECC_CURVE_PARAMETERS")
8484
yield aws_encryption_sdk.internal.crypto.elliptic_curve._ECC_CURVE_PARAMETERS
8585

8686

87-
@pytest.yield_fixture
87+
@pytest.fixture
8888
def patch_prehashed(mocker):
8989
mocker.patch.object(aws_encryption_sdk.internal.crypto.elliptic_curve, "Prehashed")
9090
yield aws_encryption_sdk.internal.crypto.elliptic_curve.Prehashed

test/unit/test_crypto_encryption_decryptor.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,19 +21,19 @@
2121
pytestmark = [pytest.mark.unit, pytest.mark.local]
2222

2323

24-
@pytest.yield_fixture
24+
@pytest.fixture
2525
def patch_default_backend(mocker):
2626
mocker.patch.object(aws_encryption_sdk.internal.crypto.encryption, "default_backend")
2727
yield aws_encryption_sdk.internal.crypto.encryption.default_backend
2828

2929

30-
@pytest.yield_fixture
30+
@pytest.fixture
3131
def patch_cipher(mocker):
3232
mocker.patch.object(aws_encryption_sdk.internal.crypto.encryption, "Cipher")
3333
yield aws_encryption_sdk.internal.crypto.encryption.Cipher
3434

3535

36-
@pytest.yield_fixture
36+
@pytest.fixture
3737
def patch_decryptor(mocker):
3838
mocker.patch.object(aws_encryption_sdk.internal.crypto.encryption, "Decryptor")
3939
yield aws_encryption_sdk.internal.crypto.encryption.Decryptor

test/unit/test_crypto_encryption_encryptor.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,19 +22,19 @@
2222
pytestmark = [pytest.mark.unit, pytest.mark.local]
2323

2424

25-
@pytest.yield_fixture
25+
@pytest.fixture
2626
def patch_default_backend(mocker):
2727
mocker.patch.object(aws_encryption_sdk.internal.crypto.encryption, "default_backend")
2828
yield aws_encryption_sdk.internal.crypto.encryption.default_backend
2929

3030

31-
@pytest.yield_fixture
31+
@pytest.fixture
3232
def patch_cipher(mocker):
3333
mocker.patch.object(aws_encryption_sdk.internal.crypto.encryption, "Cipher")
3434
yield aws_encryption_sdk.internal.crypto.encryption.Cipher
3535

3636

37-
@pytest.yield_fixture
37+
@pytest.fixture
3838
def patch_encryptor(mocker):
3939
mocker.patch.object(aws_encryption_sdk.internal.crypto.encryption, "Encryptor")
4040
yield aws_encryption_sdk.internal.crypto.encryption.Encryptor

test/unit/test_crypto_prehashing_authenticator.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,37 +23,37 @@
2323
pytestmark = [pytest.mark.unit, pytest.mark.local]
2424

2525

26-
@pytest.yield_fixture
26+
@pytest.fixture
2727
def patch_set_signature_type(mocker):
2828
mocker.patch.object(_PrehashingAuthenticator, "_set_signature_type")
2929
yield _PrehashingAuthenticator._set_signature_type
3030

3131

32-
@pytest.yield_fixture
32+
@pytest.fixture
3333
def patch_build_hasher(mocker):
3434
mocker.patch.object(_PrehashingAuthenticator, "_build_hasher")
3535
yield _PrehashingAuthenticator._build_hasher
3636

3737

38-
@pytest.yield_fixture
38+
@pytest.fixture
3939
def patch_cryptography_utils_verify_interface(mocker):
4040
mocker.patch.object(aws_encryption_sdk.internal.crypto.authentication, "verify_interface")
4141
yield aws_encryption_sdk.internal.crypto.authentication.verify_interface
4242

4343

44-
@pytest.yield_fixture
44+
@pytest.fixture
4545
def patch_cryptography_ec(mocker):
4646
mocker.patch.object(aws_encryption_sdk.internal.crypto.authentication, "ec")
4747
yield aws_encryption_sdk.internal.crypto.authentication.ec
4848

4949

50-
@pytest.yield_fixture
50+
@pytest.fixture
5151
def patch_cryptography_hashes(mocker):
5252
mocker.patch.object(aws_encryption_sdk.internal.crypto.authentication, "hashes")
5353
yield aws_encryption_sdk.internal.crypto.authentication.hashes
5454

5555

56-
@pytest.yield_fixture
56+
@pytest.fixture
5757
def patch_cryptography_default_backend(mocker):
5858
mocker.patch.object(aws_encryption_sdk.internal.crypto.authentication, "default_backend")
5959
yield aws_encryption_sdk.internal.crypto.authentication.default_backend

0 commit comments

Comments
 (0)