|
|
|
|
|
by tdavis
5204 days ago
|
|
Now make some other code use your "mock" without editing its source. Now assert on the calls made to "bar()," including arguments. Now make it raise an exception without writing a second class. And make it return something else without writing a third. Now patch a built-in. And a context manager. And a dictionary. When you're done with that, mock a class without writing a new class at all. If you honestly think that sub-classing is equivalent to mocking/stubbing, you don't understand the purpose of the activity. |
|