Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Convert manual integration tests to pytest tests #148
Convert manual integration tests to pytest tests #148
Changes from 2 commits
7244924
26295d6
7a7f51c
ee2382f
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we use numbering to enumerate these steps? I think it would help with the readability! :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While the comments help, this is a bit involved and long so you might consider breaking this up into smaller fixtures that are then called by this fixture for readability
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, that's a good suggestion. This prompted utilizing a
contextmanager
to temporarily reset the environment, for each integration test, which gaurantees it's torn down correctly as well.Also broke the lambda config and SMS retrievals into their own functions. Hopefully you can look at this fixture now (changes coming in a new commit) and see that it's:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure of the best practice on something like this but this design pattern feels weird (defining a function inside a fixture). It seems possible to just stick this at the top:
But I don't have enough experience with this type of integration tests to have much confidence in commenting on this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good call! Much easier to call via a loop, and can tighten up that S3 file check/upload code as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd move this into the docstring, I like this function
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Normally I'd agree, but this hook is a built-in function for pytests, and is called just by virtue of being named
pytest_collection_modifyitems
. Therefore, if we want to add other logic that should fire during this hook, it would also get added here.But now that you mention it.. this behavior could be put into another function that this hook calls. Then, that function's docstring can explain what it does, and future logic / functions could be added to this hook if needed.
Thanks for flagging!