Comment 11 for bug 446150

Revision history for this message
GuilhemBichot (guilhem-bichot) wrote :

I looked at this in winpdb, and it is weird.
sock.rev() raises socket.timeout (normal, it seems). This is caught by the try/except of cmd_query(), which then raises it again. So we go up one level, in cursor.py:
        except StandardError, e:
            raise errors.InterfaceError(
                "Failed executing the operation; %s" % e)
which raises InterfaceError, as the unit test expects.
This exception is then caught inside failUnlessRaises(), as expected, so we come to the "return"

    def failUnlessRaises(self, excClass, callableObj, *args, **kwargs):
        <cut>
        try:
            callableObj(*args, **kwargs)
        except excClass:
            return # <<< we come here

but, somehow it seems that the exception still comes out of this, as the debugger says that
        self.assertRaises(errors.InterfaceError,
            c.execute, "SELECT SLEEP(%d)" % (config['connection_timeout']+4))
produces an exception.
Weird: the exception was apparently caught but it seems to come out.