MCPcopy Index your code
hub / github.com/PyMySQL/mysqlclient / test_rowcount

Method test_rowcount

tests/test_MySQLdb_dbapi20.py:130–158  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

128
129 # Same complaint as for fetchall and fetchone
130 def test_rowcount(self):
131 con = self._connect()
132 try:
133 cur = con.cursor()
134 self.executeDDL1(cur)
135 # self.assertEqual(cur.rowcount,-1,
136 # 'cursor.rowcount should be -1 after executing no-result '
137 # 'statements'
138 # )
139 cur.execute(
140 "insert into %sbooze values ('Victoria Bitter')" % (self.table_prefix)
141 )
142 # self.assertTrue(cur.rowcount in (-1,1),
143 # 'cursor.rowcount should == number or rows inserted, or '
144 # 'set to -1 after executing an insert statement'
145 # )
146 cur.execute("select name from %sbooze" % self.table_prefix)
147 self.assertTrue(
148 cur.rowcount in (-1, 1),
149 "cursor.rowcount should == number of rows returned, or "
150 "set to -1 after executing a select statement",
151 )
152 self.executeDDL2(cur)
153 # self.assertEqual(cur.rowcount,-1,
154 # 'cursor.rowcount not being reset to -1 after executing '
155 # 'no-result statements'
156 # )
157 finally:
158 con.close()
159
160 def test_callproc(self):
161 pass # performed in test_MySQL_capabilities

Callers

nothing calls this directly

Calls 6

_connectMethod · 0.80
cursorMethod · 0.80
executeDDL1Method · 0.80
executeMethod · 0.80
executeDDL2Method · 0.80
closeMethod · 0.80

Tested by

no test coverage detected