Taragolis commented on code in PR #38603:
URL: https://github.com/apache/airflow/pull/38603#discussion_r1544232649
##########
tests/providers/amazon/aws/hooks/test_base_aws.py:
##########
@@ -1123,13 +1123,13 @@ def
test_raise_no_creds_default_credentials_strategy(tmp_path_factory, monkeypat
monkeypatch.delenv(env_key, raising=False)
hook = AwsBaseHook(aws_conn_id=None, client_type="sts")
- with pytest.raises(NoCredentialsError):
+ with pytest.raises(NoCredentialsError) as credential_error:
# Call AWS STS API method GetCallerIdentity
# which should return result in case of valid credentials
- result = hook.conn.get_caller_identity()
+ hook.conn.get_caller_identity()
# In normal circumstances lines below should not execute.
# We want to show additional information why this test not passed
- assert not result, f"Credentials Method:
{hook.get_session().get_credentials().method}"
+ assert str(credential_error.value) == "Unable to locate credentials"
Review Comment:
The commend no more relevant, so it should be changed / removed
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]