I'm running some unit tests and mocking sqs
from moto import mock_sqs
@pytest.fixture
def moto_boto():
@mock_sqs
def boto_resources():
# setup mocked SQS for output
sqs_resource = boto3.resource('sqs', region_name=REGION)
sqs_resource.create_queue(QueueName="my-queue-sqs.fifo", Attributes={"FifoQueue": "true"})
return boto_resources
@mock_sqs
def test_main(moto_boto):
moto_boto()
main()
Within main()
there is a call info = ssm_client.get_parameter(Name='info')
, which gives an error
An error occurred (UnrecognizedClientException) when calling the GetParameter operation: The security token included in the request is invalid.
Seemingly, mocking AWS SQS overrides the security tokens for all AWS clients and resources (in this case SSM). How can I mock sqs and also access live resources?