Skip to content

Commit a21d2f5

Browse files
committed
chore: linting fixes
1 parent e2733e2 commit a21d2f5

File tree

5 files changed

+12
-10
lines changed

5 files changed

+12
-10
lines changed

src/dynamodb_encryption_sdk/structures.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ class TableIndex(object):
223223
partition = attr.ib(validator=attr.validators.instance_of(six.string_types))
224224
sort = attr.ib(validator=attr.validators.optional(attr.validators.instance_of(six.string_types)), default=None)
225225

226-
def __init__(self, partition, sort=None):
226+
def __init__(self, partition, sort=None): # noqa=D107
227227
# type: (Text, Optional[Text]) -> None
228228
# Workaround pending resolution of attrs/mypy interaction.
229229
# https://github.com/python/mypy/issues/2088

test/acceptance/acceptance_test_utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,12 +159,12 @@ def _meta_table_prep(table_name, items_filename):
159159
table_data = json.load(f)
160160
request_items = {}
161161

162-
for table_name, items in table_data.items():
162+
for this_table_name, items in table_data.items():
163163
requests = []
164164
for item in items:
165165
_decode_item(item)
166166
requests.append({"PutRequest": {"Item": item}})
167-
request_items[table_name] = requests
167+
request_items[this_table_name] = requests
168168
client.batch_write_item(RequestItems=request_items)
169169

170170

test/functional/functional_test_utils.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,8 @@ class PassThroughCryptographicMaterialsProviderThatRequiresAttributes(Cryptograp
178178
def __init__(self, passthrough_cmp):
179179
self._passthrough_cmp = passthrough_cmp
180180

181-
def _assert_attributes_set(self, encryption_context):
181+
@staticmethod
182+
def _assert_attributes_set(encryption_context):
182183
# type: (EncryptionContext) -> None
183184
if not encryption_context.attributes:
184185
raise ValueError("Encryption context attributes MUST be set!")
@@ -386,7 +387,7 @@ def diverse_item():
386387
return copy.deepcopy(base_item)
387388

388389

389-
_reserved_attributes = set([attr.value for attr in ReservedAttributes])
390+
_reserved_attributes = {attr.value for attr in ReservedAttributes}
390391

391392

392393
def return_requestitems_as_unprocessed(*args, **kwargs):
@@ -529,7 +530,7 @@ def cycle_batch_writer_check(raw_table, encrypted_table, initial_actions, initia
529530
for item in items:
530531
writer.put_item(item)
531532

532-
ddb_keys = [key for key in TEST_BATCH_KEYS]
533+
ddb_keys = TEST_BATCH_KEYS.copy()
533534
encrypted_items = [raw_table.get_item(Key=key, ConsistentRead=True)["Item"] for key in ddb_keys]
534535
check_many_encrypted_items(
535536
actual=encrypted_items, expected=items, attribute_actions=check_attribute_actions, transformer=_nop_transformer
@@ -756,6 +757,7 @@ def client_cycle_batch_items_check_scan_paginator(
756757
scan the table with encrypted client paginator to get decrypted items,
757758
then verify that all items appear to have been encrypted correctly.
758759
""" # noqa=D401
760+
# pylint: disable=too-many-locals
759761
kwargs = {}
760762
if region_name is not None:
761763
kwargs["region_name"] = region_name

test/functional/materials/test_raw.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def test_no_encryption_key():
2424
encryption_materials = RawEncryptionMaterials(signing_key=signing_key)
2525

2626
with pytest.raises(AttributeError) as excinfo:
27-
encryption_materials.encryption_key
27+
encryption_materials.encryption_key # calls a property, so pylint: disable=pointless-statement
2828

2929
excinfo.match("No encryption key available")
3030

@@ -34,6 +34,6 @@ def test_no_decryption_key():
3434
decryption_materials = RawDecryptionMaterials(verification_key=verification_key)
3535

3636
with pytest.raises(AttributeError) as excinfo:
37-
decryption_materials.decryption_key
37+
decryption_materials.decryption_key # calls a property, so pylint: disable=pointless-statement
3838

3939
excinfo.match("No decryption key available")

test/integration/integration_test_utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ def _build_kms_cmp(require_attributes):
5454
inner_cmp = AwsKmsCryptographicMaterialsProvider(key_id=cmk_arn_value())
5555
if require_attributes:
5656
return functional_test_utils.PassThroughCryptographicMaterialsProviderThatRequiresAttributes(inner_cmp)
57-
else:
58-
return inner_cmp
57+
58+
return inner_cmp
5959

6060

6161
def set_parameterized_kms_cmps(metafunc, require_attributes=True):

0 commit comments

Comments
 (0)