git init
or
| """ | |
| TL/DR: | |
| Never instantiate mock.Mock() directly. | |
| Instead use either mock.create_autospec(YourClass) OR mock.patch('YourClass', autospec=True). | |
| The "spec" feature of Mock is great, it helps avoid your mocked API drifting out of sync with your real API. | |
| But there is a gotcha if you are mocking classes directly - it's easy to mock the class but you need to | |
| ensure the spec applies to the *instance* as well. | |
| """ |