Skip to content

Pytest4 #98

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Nov 15, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -20,4 +20,5 @@ docs/build
.pytest_cache

#PyCharm
.idea/
.idea/
venv/
11 changes: 8 additions & 3 deletions test/integration/integration_test_utils.py
Original file line number Diff line number Diff line change
@@ -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