In PR #2669 we have added that's test specific code, we should avoid writing such code. We have done this in a few places and i think its a bad habit, I believe we should take the time to re-structure the code where necessary.
Its an indication that code needs to be refactored for testability.
Solution:
- Create a method
initialize
- Move the code thats inside the
if condition in the constructor into the initialize method
- For testing purposes, create a subclass of the
PythonSettings class, override the initialize method.
In PR #2669 we have added that's test specific code, we should avoid writing such code. We have done this in a few places and i think its a bad habit, I believe we should take the time to re-structure the code where necessary.
Its an indication that code needs to be refactored for testability.
Solution:
initializeif conditionin the constructor into theinitializemethodPythonSettingsclass, override theinitializemethod.