Skip to content

Commit bdf167e

Browse files
authored
Merge pull request #98 from mattsb42-aws/pytest4
Pytest4
2 parents c21e03b + ba101bc commit bdf167e

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,5 @@ docs/build
2020
.pytest_cache
2121

2222
#PyCharm
23-
.idea/
23+
.idea/
24+
venv/

test/integration/integration_test_utils.py

+8-3
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,7 @@
2828
DDB_TABLE_NAME = "DDB_ENCRYPTION_CLIENT_TEST_TABLE_NAME"
2929

3030

31-
@pytest.fixture
32-
def cmk_arn():
31+
def cmk_arn_value():
3332
"""Retrieve the target CMK ARN from environment variable."""
3433
arn = os.environ.get(AWS_KMS_KEY_ID, None)
3534
if arn is None:
@@ -43,9 +42,15 @@ def cmk_arn():
4342
raise ValueError("KMS CMK ARN provided for integration tests must be a key not an alias")
4443

4544

45+
@pytest.fixture
46+
def cmk_arn():
47+
"""As of Pytest 4.0.0, fixtures cannot be called directly."""
48+
return cmk_arn_value()
49+
50+
4651
@pytest.fixture
4752
def aws_kms_cmp():
48-
return AwsKmsCryptographicMaterialsProvider(key_id=cmk_arn())
53+
return AwsKmsCryptographicMaterialsProvider(key_id=cmk_arn_value())
4954

5055

5156
@pytest.fixture

0 commit comments

Comments
 (0)