From 2014edc79e2cb7e76a5e87be9f51087748d2d716 Mon Sep 17 00:00:00 2001 From: mattsb42-aws Date: Thu, 15 Nov 2018 14:04:22 -0800 Subject: [PATCH 1/2] add PyCharm venv directory to gitignore --- .gitignore | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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/ From ba101bc0de921ca7d022c6ef47e042dd8fdcef34 Mon Sep 17 00:00:00 2001 From: mattsb42-aws Date: Thu, 15 Nov 2018 14:04:31 -0800 Subject: [PATCH 2/2] remove direct fixture call disabled in Pytest 4.0.0 --- test/integration/integration_test_utils.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) 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