diff --git a/.gitignore b/.gitignore index 49dd343e..8e51e96d 100644 --- a/.gitignore +++ b/.gitignore @@ -20,4 +20,5 @@ docs/build .pytest_cache #PyCharm -.idea/ \ No newline at end of file +.idea/ +venv/ diff --git a/test/integration/integration_test_utils.py b/test/integration/integration_test_utils.py index c037cf3d..1bb15d58 100644 --- a/test/integration/integration_test_utils.py +++ b/test/integration/integration_test_utils.py @@ -28,8 +28,7 @@ DDB_TABLE_NAME = "DDB_ENCRYPTION_CLIENT_TEST_TABLE_NAME" -@pytest.fixture -def cmk_arn(): +def cmk_arn_value(): """Retrieve the target CMK ARN from environment variable.""" arn = os.environ.get(AWS_KMS_KEY_ID, None) if arn is None: @@ -43,9 +42,15 @@ def cmk_arn(): raise ValueError("KMS CMK ARN provided for integration tests must be a key not an alias") +@pytest.fixture +def cmk_arn(): + """As of Pytest 4.0.0, fixtures cannot be called directly.""" + return cmk_arn_value() + + @pytest.fixture def aws_kms_cmp(): - return AwsKmsCryptographicMaterialsProvider(key_id=cmk_arn()) + return AwsKmsCryptographicMaterialsProvider(key_id=cmk_arn_value()) @pytest.fixture