Mock's autospec injects a wrong argument into a called function
问题 My understanding is that autospec in its simplest form as used here will check the signature of the function which is being mocked against the presented arguments. Its purpose is to raise an error if they do not match. In the code below it seems to inject an additional argument - the object itself. Why does the use of the mock module's autospec lead to the unexpected behavior shown here? For this question I've created a simplified version in the module simplebutton . When it's run as the main