<p dir="ltr">Why not as a separate function? mock.patch(.object) are basically equivalents of setattr, so if someone wants a delattr, I&#39;d expect it as a separate thing personally.</p>
<p dir="ltr">-Julian</p>
<div class="gmail_quote">On Dec 5, 2014 11:55 AM, &quot;Chris Withers&quot; &lt;<a href="mailto:chris@simplistix.co.uk">chris@simplistix.co.uk</a>&gt; wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi All,<br>
<br>
I&#39;m excited to see how far mock.patch has come, mainly as I&#39;m hoping I can deprecate testfixtures.Replacer as a result ;-)<br>
<br>
The only think it looks like Mock can&#39;t currently do is remove attributes or dictionary items:<br>
<br>
<a href="https://pythonhosted.org/testfixtures/mocking.html#removing-attributes-and-dictionary-items" target="_blank">https://pythonhosted.org/<u></u>testfixtures/mocking.html#<u></u>removing-attributes-and-<u></u>dictionary-items</a><br>
<br>
Michael, would you be up for me adding that to Mock or is it a non-starter?<br>
<br>
I&#39;d be happy to approach using either a delete=True option to patch() and patch.dict() (I don&#39;t really understand what patch.object does, so can&#39;t comment...) or, alternatively, a not_there or deleted marker object like I did in testfixtures.<br>
<br>
Lemme know your thoughts...<br>
<br>
Chris<br>
<br>
______________________________<u></u>_________________<br>
testing-in-python mailing list<br>
<a href="mailto:testing-in-python@lists.idyll.org" target="_blank">testing-in-python@lists.idyll.<u></u>org</a><br>
<a href="http://lists.idyll.org/listinfo/testing-in-python" target="_blank">http://lists.idyll.org/<u></u>listinfo/testing-in-python</a><br>
</blockquote></div>