hi, i&#39;m new here and hope my question wasn&#39;t answered earlier. (i did look at a bunch of archive threads ...) i derived a class from a third-party class; it looks a bit like this:<br><br>class Connection(pymongo.Connection):<br>



<div>    def __init__(self, spam):<br>        # translate spam ...<br>        pymongo.Connection.__init__(self, host, port)<br><br>using mock 0.7.2, i wrote a unit test that validates the host and port values passed to the base class constructor. however, this test fails when nosetests runs it. without nose (1.0.0), i can get the test to succeed in two ways:<br>

<br>1) assigning pymongo.Connection to a stub connection class, or<br>2) modifying sys.path and importing a fake pymongo package.<br><br>mock&#39;s documentation mentions that &quot;<cite>nosetests</cite> does some manipulation of <cite>sys.modules</cite> (along with <cite>sys.path</cite>
manipulation).&quot; so i think this &quot;manipulation&quot; is preventing me from patching my connection.<br><br>
</div>has anyone seen this problem before? more generally/importantly, what&#39;s a good way of mocking third-party base classes?? i&#39;m using Python 2.7 and mock usage is optional (though it&#39;s hard to imagine *not* using it), but nose usage is mandatory.<br>
<br>
<br>Felix<br><br>