'Is a rollback called in the context manager?'

def CheckContextManagerRollback(self):

    global did_rollback
    self.assertEqual(did_rollback, False)
    try:
        with self.con:
            self.con.execute('insert    into    test(c)    values    (4)')
            self.con.execute('insert    into    test(c)    values    (4)')
    except sqlite.IntegrityError:
        pass
    self.assertEqual(did_rollback, True)
