title: Can I fake/mock the type of my mock objects in python unittests
body: <p>In my python code I check the type of one of the parameters to make sure it is of the type I expect. For instance:  </p>
  
  <pre><code>def myfunction(dbConnection):
      if (type(dbConnection)&lt;&gt;bpgsql.Connection):
          r['error'] += ' invalid database connection'
  </code></pre>
  
  <p>I want to pass a mock connection for testing purposes. Is there a way to make the mock object pretend to be of the correct type?</p>