Skip to content
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

placebo_session fails without session setup #61

Open
boompig opened this issue May 3, 2017 · 2 comments
Open

placebo_session fails without session setup #61

boompig opened this issue May 3, 2017 · 2 comments

Comments

@boompig
Copy link

boompig commented May 3, 2017

When using placebo.utils.placebo_session as a decorator, I had the following error:

__________________________________________ test_publish_incidents_placebo __________________________________________

args = (), kwargs = {}, session_kwargs = {'region_name': 'us-east-1'}, profile_name = None
session = Session(region_name='us-east-1')

    @functools.wraps(function)
    def wrapper(*args, **kwargs):
        session_kwargs = {
            'region_name': os.environ.get('AWS_DEFAULT_REGION', 'us-east-1')
        }
        profile_name = os.environ.get('PLACEBO_PROFILE', None)
        if profile_name:
            session_kwargs['profile_name'] = profile_name

        session = boto3.Session(**session_kwargs)

>       self = args[0]
E       IndexError: tuple index out of range

env/lib/python2.7/site-packages/placebo/utils.py:29: IndexError
======================================== 1 failed, 5 passed in 1.92 seconds ========================================
make: *** [test] Error 1
@jmeachum
Copy link

I have the same issue. Seems others have worked around by not using the decorator, it doesn't appear to work as documented. I did stumble upon a fixture used in the ansible aws repo.
https://github.com/ansible-collections/amazon.aws/blob/main/tests/unit/utils/amazon_placebo_fixtures.py

@garnaat
Copy link
Owner

garnaat commented Dec 23, 2021

Thanks. I'll take a look in the next day or two and try to fix it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants