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

list-user-policies Tests failing in Python 3.6 #8

Closed
simonw opened this issue Nov 3, 2021 · 1 comment
Closed

list-user-policies Tests failing in Python 3.6 #8

simonw opened this issue Nov 3, 2021 · 1 comment
Labels
bug Something isn't working

Comments

@simonw
Copy link
Owner

simonw commented Nov 3, 2021

E             At index 4 diff: "call().get_user_policy(PolicyName='policy-one', UserName='one')"
              != "call().get_user_policy(UserName='one', PolicyName='policy-one')"

Looks like there's no guarantee to the ordering of the parameters when they are pretty-printed here:

assert [str(c) for c in boto3.mock_calls] == [
"call()",
"call('iam')",
"call().get_paginator('list_users')",
"call().get_paginator('list_user_policies')",
"call().get_user_policy(UserName='one', PolicyName='policy-one')",

@simonw simonw added the bug Something isn't working label Nov 3, 2021
@simonw
Copy link
Owner Author

simonw commented Nov 3, 2021

Since the __str__ thing described in https://til.simonwillison.net/pytest/pytest-mock-calls isn't a problem here I can ditch the str() and do a straight comparison to boto3.mock_calls.

@simonw simonw closed this as completed in 693179d Nov 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant