What Is patch()?
00:30 this is okay for very simple use cases and experimenting, but usually you would want to patch objects in separate files. Having your tests in a separate file is good for organization, it’s a good practice to do that, and you want to separate your mock objects from your actual codebase, right?
So what I’ve done is I created another file called
tests.py. It is located in the same directory as
my_calendar.py and that’s going to be important because we’re going to be doing some importing.
Become a Member to join the conversation.