You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I extensively use ipdb for debugging in the most strange situations, and many times I come across cases in which a specific function requires a predefined setup in prod to work as expected, which is hard to do during debugging.
In such cases I usually have to patch the mentioned function to behave as intended just to be able to continue debugging.
The suggestion is to add a parameter to the r(turn) command to patch the return value of the function. In this case, the current code will continue until returns, BUT it will return the INTENDED value.
150 def very_complex_setup(**kwargs):
151 # Make sure all dependencies are set up.
--> 152 result = other_setups(**kwargs)
153 return result
ipdb> injected_result = True
ipdb> return injected_result
This command is expected to ignore the result and instead return injected_result as the value of the very_complex_setup function.
The text was updated successfully, but these errors were encountered:
I extensively use
ipdb
for debugging in the most strange situations, and many times I come across cases in which a specific function requires a predefined setup in prod to work as expected, which is hard to do during debugging.In such cases I usually have to patch the mentioned function to behave as intended just to be able to continue debugging.
The suggestion is to add a parameter to the
r(turn)
command to patch the return value of the function. In this case, the current code will continue until returns, BUT it will return the INTENDED value.This command is expected to ignore the
result
and instead returninjected_result
as the value of thevery_complex_setup
function.The text was updated successfully, but these errors were encountered: