Demystifying the Patch Function

Loading

Follow to receive video recommendations   a   A


One of the most challenging and important thing fors for Python developers learn is the unittest mock library. The patch function is in particular confusing- there are many different ways to use it. Should I use a context manager? Decorator? When would I use it manually? Improperly used patch functions can make unit tests useless, all the while making them look as if they are correctly testing code.Let’s learn how to wield patch with confidence!

Editors Note:

I would like to work with open source projects to create a branch of the tree with all of the best videos for your open source project. Please send me an email if you are interested.