-
Notifications
You must be signed in to change notification settings - Fork 322
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
Prevent save config to home in tests #2016
Prevent save config to home in tests #2016
Conversation
@GateBuilder I suspect but I am not sure that these context managers does this because there is a bunch of places in the code where a new config is generated by calling |
For refererence the config instance creation below all look suspicious
|
These calls to save_to_home could also be problematic if they are called by tests
We may need to make sure that we set the home dir to a isolated temp dir before any of these are called in a test |
@jenshnielsen I tested the one of the context managers without save_to_home where I first change my location and work_station numbers. They returned back the original state in the config file at my home directory without a problem. |
@GateBuilder great lets hope that is the case for all of them :) |
@jenshnielsen Ok I understand what you mean, indeed why don't we use the default config?. Let me change this PR to a draft; rather tricky stuff here I do not wanna rush. |
I have made some changes in separate tests and files. The followings are the remaining problems?
Overall, this is a fine improvement. Please let me know if you have any suggestions concerning getting rid off remaining |
I think we should land this as is if passing and then revisit the remaining ones |
previous version would overwrite the config class with the dict internal to the config class :(
Codecov Report
@@ Coverage Diff @@
## master #2016 +/- ##
=======================================
Coverage 71.31% 71.31%
=======================================
Files 149 149
Lines 19866 19866
=======================================
Hits 14167 14167
Misses 5699 5699 |
This PR removes redundant and unnecessary execution of
save_to_home
function in tests.The functionality of the corresponding context managers are not effected and they do not need this command. Although I tested their functionality without this attribute, please confirm that this is indeed the case.
@jenshnielsen