-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
improve settings priority, #343
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
Conversation
514a517 to
501d4fe
Compare
Codecov Report
@@ Coverage Diff @@
## master #343 +/- ##
=====================================
Coverage 100% 100%
=====================================
Files 14 14
Lines 1820 1818 -2
Branches 356 356
=====================================
- Hits 1820 1818 -2 |
501d4fe to
7ae7953
Compare
| s = Settings(__config_settings__=config, b='argument b', c='argument c') | ||
| assert s.a == 'config a' | ||
| assert s.b == 'argument b' | ||
| assert s.c == 'env setting c' |
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.
Not sure if I am misreading something but according to the docs the order of preference is class_defaults < env < arguments, however, your test is proving that class_defaults < arguments < env. I might be misreading this completely but my tests seem to confirm 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.
Ok, just realized that your test case is testing changing the order + using the __config_settings__ trick, not the default case. So all is good and I managed to get it working exactly as I wanted, thanks a lot!
0b4f10f to
3c05c04
Compare
This implements support for constraining datetime objects based on them having or not having timezone info. The aware kind constrains to objects that have timezone info, and symmetrically, the naive kind constrains to objects that do not have timezone info.
Change Summary
Improve documentation for settings priority and allow them to be more easily changed.
Related issue number
ref #341
Checklist
HISTORY.rsthas been updated#<number>@whatever