<p>Hey Ken.</p>
<p>I can&#39;t elaborate much from here, but your issue is due to not replacing super in the correct spot, so your mom isn&#39;t being injected properly.</p>
<p>You need to replace in the module under test (can&#39;t link to the docs but there&#39;s a helpful article there if you can&#39;t figure it out).</p>
<p>Something like:</p>
<p>with mock.patch(&quot;mymodule.super&quot;, create=True) as mock_super:<br>
    mock_super.return_value.config.whatever = 12<br>
     exercise()<br>
     assert()<br></p>
<p>Remembering your code from memory and typing off the cuff, but hopefully this puts you on your way, otherwise I&#39;m sure someone else can pick it up from here. Also note the need for create.</p>
<p>Also, doing this is messy. You should give some thought into rethinking your design. Specifically, separating child from superclass is smelly, maybe the child ought not be a child at all (and maybe it should compose with the super).</p>

<p>Anyways, good luck</p>
<p>Julian</p>
<div class="gmail_quote">On Dec 20, 2012 9:49 AM, &quot;Ken Hagler&quot; &lt;<a href="mailto:khagler@orange-road.com">khagler@orange-road.com</a>&gt; wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On Dec 19, 2012, at 2:57 PM, John Wong &lt;<a href="mailto:gokoproject@gmail.com">gokoproject@gmail.com</a>&gt; wrote:<br>
<br>
&gt; I usually mock a class by using autospec parameter so the specs of the<br>
&gt; class remains except it&#39;s MOCKed.<br>
&gt; That allows me to just quickly mock out the class I want while keeping all<br>
&gt; the necessary attributes/method I need.<br>
<br>
Reasonable, but would I use Build or DevBuild for that? I suppose I&#39;m wary of adding another factor that I don&#39;t particularly understand when it&#39;s already not working...<br>
<br>
&gt; Also, the error doesn&#39;t indicate it&#39;s a mock object. If it were a mock, I<br>
&gt; believe you would see &quot;MagicMock object&quot; rather than DevBuild object.<br>
<br>
Okay, any idea what I&#39;m doing wrong there?<br>
--<br>
                              Ken Hagler<br>
<br>
|                   <a href="http://www.orange-road.com/" target="_blank">http://www.orange-road.com/</a>                   |<br>
|   And tho&#39; we are not now that strength which in old days       |<br>
|   Moved earth and heaven, that which we are, we are --Tennyson  |<br>
<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>
</blockquote></div>