Did Mock&#39;s documentation ever tell you not to call the super init?  Generally speaking this is something subclasses need to do in Python, and not doing it is a latent bug.<div><br></div><div>-m</div><div class="gmail_extra">

<br><br><div class="gmail_quote">On 20 November 2012 11:53, Eric Rasmussen <span dir="ltr">&lt;<a href="mailto:ericrasmussen@gmail.com" target="_blank">ericrasmussen@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

Hello,<br><br>I am upgrading from Mock 0.7 and it looks like there was a backwards incompatible change in 0.8: it&#39;s apparently no longer possible to create a class inheriting from Mock unless you call the super method. Can someone explain why the below works in 0.7 but not in 0.8 and above?<br>


<br>class MyMock(Mock):<br>    def __init__(self, name):<br>        <a href="http://self.name" target="_blank">self.name</a> = name<br><br>Now I have to write:<br><br>class MyMock(Mock):<br>    def __init__(self, name):<br>

        Mock.__init__(self)<br>
        <a href="http://self.name" target="_blank">self.name</a> = name<br><br>I did find an issue here: <a href="http://code.google.com/p/mock/issues/detail?id=161" target="_blank">http://code.google.com/p/mock/issues/detail?id=161</a><br>

<br>But it does not mention the reason for the change. I was unable to find any mention of a backwards incompatible change of this nature in the changelog, which is concerning. I just want to make sure I fully understand the scope of the change. If you can point me to any documentation or pull requests that show when and why this change was made that would be an enormous help. <br>


<br>It&#39;s really important for a project I&#39;m working on that we document this new requirement for creating a subclass of Mock, so I appreciate any insight you can offer.<br><br>Thank you,<br>Eric<br>
<br>_______________________________________________<br>
testing-in-python mailing list<br>
<a href="mailto:testing-in-python@lists.idyll.org">testing-in-python@lists.idyll.org</a><br>
<a href="http://lists.idyll.org/listinfo/testing-in-python" target="_blank">http://lists.idyll.org/listinfo/testing-in-python</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br>Martin<br><br>
</div>