Skip to content

Commit 8c3bab0

Browse files
committed
pylint-tests update and fixes
1 parent 1f48bd2 commit 8c3bab0

File tree

8 files changed

+21
-16
lines changed

8 files changed

+21
-16
lines changed

test/acceptance/acceptance_test_utils.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
import sys
1919

2020
import pytest
21-
from six.moves.urllib.parse import urlparse
21+
from six.moves.urllib.parse import urlparse # moves confuse pylint: disable=wrong-import-order
2222

2323
from dynamodb_encryption_sdk.delegated_keys.jce import JceNameLocalDelegatedKey
2424
from dynamodb_encryption_sdk.identifiers import EncryptionKeyTypes, KeyEncodingType
@@ -34,7 +34,7 @@
3434
))
3535

3636
# Convenience imports
37-
import functional_test_vector_generators # noqa: E402,I100
37+
import functional_test_vector_generators # noqa: E402,I100 pylint: disable=import-error,wrong-import-position
3838

3939
_ENCRYPTED_ITEM_VECTORS_DIR = os.path.join(
4040
os.path.abspath(os.path.dirname(__file__)),
@@ -66,6 +66,7 @@ def _decode_item(item):
6666

6767

6868
def _build_plaintext_items(plaintext_file, version):
69+
# pylint: disable=too-many-locals
6970
with open(plaintext_file) as f:
7071
plaintext_data = json.load(f)
7172

@@ -209,6 +210,7 @@ def _expand_items(ciphertext_items, plaintext_items):
209210

210211

211212
def load_scenarios():
213+
# pylint: disable=too-many-locals
212214
with open(_SCENARIO_FILE) as f:
213215
scenarios = json.load(f)
214216
keys_file = _filename_from_uri(scenarios['keys'])

test/functional/encrypted/test_client.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
check_encrypted_item, cycle_batch_item_check, set_parametrized_actions, set_parametrized_cmp,
2222
set_parametrized_item, TEST_KEY, TEST_TABLE_NAME
2323
)
24-
from ..functional_test_utils import example_table # noqa
24+
from ..functional_test_utils import example_table # noqa pylint: disable=unused-import
2525
from ..hypothesis_strategies import ddb_items, SLOW_SETTINGS, VERY_SLOW_SETTINGS
2626

2727
pytestmark = [pytest.mark.functional, pytest.mark.local]

test/functional/encrypted/test_resource.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
from ..functional_test_utils import (
1919
cycle_batch_item_check, set_parametrized_actions, set_parametrized_cmp, set_parametrized_item, TEST_TABLE_NAME
2020
)
21-
from ..functional_test_utils import example_table # noqa
21+
from ..functional_test_utils import example_table # noqa pylint: disable=unused-import
2222

2323
pytestmark = [pytest.mark.functional, pytest.mark.local]
2424

test/functional/encrypted/test_table.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
check_encrypted_item, set_parametrized_actions, set_parametrized_cmp, set_parametrized_item,
2121
TEST_KEY, TEST_TABLE_NAME
2222
)
23-
from ..functional_test_utils import example_table # noqa
23+
from ..functional_test_utils import example_table # noqa pylint: disable=unused-import
2424
from ..hypothesis_strategies import ddb_items, SLOW_SETTINGS, VERY_SLOW_SETTINGS
2525

2626
pytestmark = [pytest.mark.functional, pytest.mark.local]

test/functional/functional_test_utils.py

+7-7
Original file line numberDiff line numberDiff line change
@@ -362,13 +362,13 @@ def check_encrypted_item(plaintext_item, ciphertext_item, attribute_actions):
362362

363363

364364
def _matching_key(actual_item, expected):
365-
expected_item = [
366-
i for i in expected
367-
if i['partition_attribute'] == actual_item['partition_attribute'] and
368-
i['sort_attribute'] == actual_item['sort_attribute']
369-
]
370-
assert len(expected_item) == 1
371-
return expected_item[0]
365+
expected_item = [
366+
i for i in expected
367+
if i['partition_attribute'] == actual_item['partition_attribute'] and
368+
i['sort_attribute'] == actual_item['sort_attribute']
369+
]
370+
assert len(expected_item) == 1
371+
return expected_item[0]
372372

373373

374374
def _nop_transformer(item):

test/integration/integration_test_utils.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@
2525
))
2626

2727
# Convenience imports
28-
import functional_test_utils # noqa: E402,F401,I100
29-
import hypothesis_strategies # noqa: E402,F401,I100
28+
import functional_test_utils # noqa: E402,F401,I100 pylint: disable=import-error,unused-import,wrong-import-position
29+
import hypothesis_strategies # noqa: E402,F401,I100 pylint: disable=import-error,unused-import,wrong-import-position
3030

3131
AWS_KMS_KEY_ID = 'AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_KEY_ID'
3232

test/integration/material_providers/test_aws_kms.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
from dynamodb_encryption_sdk.encrypted import CryptoConfig
1818
from dynamodb_encryption_sdk.structures import EncryptionContext
19-
from ..integration_test_utils import aws_kms_cmp # noqa
19+
from ..integration_test_utils import aws_kms_cmp # noqa pylint: disable=unused-import
2020
from ..integration_test_utils import functional_test_utils, hypothesis_strategies
2121

2222
pytestmark = pytest.mark.integ

tox.ini

+4-1
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,10 @@ deps = {[testenv:pylint]deps}
134134
commands =
135135
pylint \
136136
--rcfile=test/pylintrc \
137-
test/unit/
137+
test/unit/ \
138+
test/acceptance/ \
139+
test/functional/ \
140+
test/integration/
138141

139142
[testenv:doc8]
140143
basepython = python3

0 commit comments

Comments
 (0)