Posted On: Feb 22, 2018
Monkey patching is a concept by which we can change the function behavior in runtime. Due to the dynamic nature of the python, we can replace the body of a class function to new one. It is very useful in testing the python application. For example, if we have any class method which returns some api data and during testing, we don’t want the api data and use some local data then we can change the function and assign another function to it.
Never Miss an Articles from us.
Python uses its own techniques to implement exception handling. <try-except> is the block that can be utilized by..