

def test_rowcount(self):
    con = self._connect()
    try:
        cur = con.cursor()
        self.executeDDL1(cur)
        self.assertEqual(cur.rowcount, (- 1), 'cursor.rowcount should be -1 after executing no-result statements')
        self.execute(("insert into %sbooze values ('Victoria Bitter')" % self.table_prefix))
        self.assertTrue((cur.rowcount in ((- 1), 1)), 'cursor.rowcount should == number or rows inserted, or set to -1 after executing an insert statement')
        cur.execute(('select name from %sbooze' % self.table_prefix))
        self.assertTrue((cur.rowcount in ((- 1), 1)), 'cursor.rowcount should == number of rows returned, or set to -1 after executing a select statement')
        self.executeDDL2(cur)
        self.assertEqual(cur.rowcount, (- 1), 'cursor.rowcount not being reset to -1 after executing no-result statements')
    finally:
        con.close()

dataset/ETHPy150Open cloudera/hue/desktop/core/ext-py/MySQL-python-1.2.5/tests/dbapi20.py DatabaseAPI20Test.test_rowcount/VarMisuse@53/82 `cur`->`self`