-
Notifications
You must be signed in to change notification settings - Fork 49
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
Make PanBase hermetic across tests by clearing _config each time #249
Make PanBase hermetic across tests by clearing _config each time #249
Conversation
Codecov Report
@@ Coverage Diff @@
## develop #249 +/- ##
===========================================
+ Coverage 79.8% 79.85% +0.04%
===========================================
Files 42 42
Lines 3204 3206 +2
Branches 415 415
===========================================
+ Hits 2557 2560 +3
Misses 503 503
+ Partials 144 143 -1
Continue to review full report at Codecov.
|
pocs/base.py
Outdated
@@ -10,6 +10,16 @@ | |||
_config = None | |||
|
|||
|
|||
def reset_config_for_test(): |
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.
What about just making this an option that is passed to PanBase, like ignore_local_config
? I can imagine there might be a situation where someone needs to reset the config for whatever reason. Or just change this function to reset_config
.
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.
There are many instances of PanBase in a running POCS system, and it doesn't make sense (to me) for them to have different global configs.
I suggested elsewhere that we might have a PanConfig object that gets passed around, and represents whatever config has been loaded by the creator of POCS and Observatory. This fix is designed to allow us to make a decision about that latter, yet still get closer to hermetic tests now.
So, I'll rename to reset_global_config, with a comment that it is intended for use in tests, but might have other uses.
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.
👍
A simple fix for issue #246.