-
Notifications
You must be signed in to change notification settings - Fork 112
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
Adding the ability to specify the yaml loader in the file_data decorator #77
Conversation
Codecov Report
@@ Coverage Diff @@
## master #77 +/- ##
=====================================
Coverage 100% 100%
=====================================
Files 1 1
Lines 122 128 +6
=====================================
+ Hits 122 128 +6
Continue to review full report at Codecov.
|
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.
It's pretty neat. I think it could be cool to support that. There are a couple of minor issues with the pull request though. Please have a look at them and we'll get this merged.
…s to data folder; add missing new line in test_functional_custom_tags.yaml
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.
All good. Thanks
Adding the ability to specify the yaml loader in the file_data decorator
In some cases it is necessary to test with actual python objects. pyyaml actually supports deserialization into objects by using yaml tags but only when using the
pyyaml.FullLoader
. pyyaml recommends the use of theload_safe
method for security reasons in most cases, which disables python specific tags and has been used here.By adding a parameter to pass a different loader, while defaulting to the
safe_load
method, I created the possibility to customize the deserialization for specific tests, while retaining the previous behavior.