Skip to content

Commit 3c2ae28

Browse files
committed
get rid of path patching (that was broken by isort anyway) in favor of relative imports for test helpers used in different test groups
1 parent 1449596 commit 3c2ae28

File tree

3 files changed

+16
-10
lines changed

3 files changed

+16
-10
lines changed

test/__init__.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License"). You
4+
# may not use this file except in compliance with the License. A copy of
5+
# the License is located at
6+
#
7+
# http://aws.amazon.com/apache2.0/
8+
#
9+
# or in the "license" file accompanying this file. This file is
10+
# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
11+
# ANY KIND, either express or implied. See the License for the specific
12+
# language governing permissions and limitations under the License.
13+
"""Stub to allow relative imports between test groups."""

test/acceptance/acceptance_test_utils.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,10 @@
1414
import base64
1515
import json
1616
import os
17-
import sys
1817
from collections import defaultdict
1918
from functools import partial
2019

2120
import boto3
22-
import functional_test_vector_generators # noqa: E402,I100 pylint: disable=import-error,wrong-import-position
2321
import pytest
2422
from six.moves.urllib.parse import urlparse # moves confuse pylint: disable=wrong-import-order
2523

@@ -33,8 +31,7 @@
3331
from dynamodb_encryption_sdk.materials.raw import RawDecryptionMaterials
3432
from dynamodb_encryption_sdk.structures import AttributeActions
3533

36-
sys.path.append(os.path.join(os.path.abspath(os.path.dirname(__file__)), "..", "functional"))
37-
34+
from ..functional import functional_test_vector_generators
3835

3936
_ENCRYPTED_ITEM_VECTORS_DIR = os.path.join(
4037
os.path.abspath(os.path.dirname(__file__)), "..", "vectors", "encrypted_item"

test/integration/integration_test_utils.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,13 @@
1212
# language governing permissions and limitations under the License.
1313
"""Helper utilities for integration tests."""
1414
import os
15-
import sys
1615

17-
# Convenience imports
18-
import functional_test_utils # noqa: E402,F401,I100 pylint: disable=import-error,unused-import,wrong-import-position
19-
import hypothesis_strategies # noqa: E402,F401,I100 pylint: disable=import-error,unused-import,wrong-import-position
2016
import pytest
2117

2218
from dynamodb_encryption_sdk.material_providers.aws_kms import AwsKmsCryptographicMaterialsProvider
2319

24-
sys.path.append(os.path.join(os.path.abspath(os.path.dirname(__file__)), "..", "functional"))
25-
20+
# convenience imports
21+
from ..functional import functional_test_utils, hypothesis_strategies
2622

2723
AWS_KMS_KEY_ID = "AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_KEY_ID"
2824
DDB_TABLE_NAME = "DDB_ENCRYPTION_CLIENT_TEST_TABLE_NAME"

0 commit comments

Comments
 (0)