I currently have the following basic Python class that I want to test: As you can see, the step() method contains an expensive API call so I want to mock it with another function that avoids the expensive API call but still increments self.steps. I found that this is possible by doing this (as seen from here): I simply create