MCPcopy Index your code
hub / github.com/PyMySQL/PyMySQL / test_autocommit

Method test_autocommit

pymysql/tests/test_connection.py:472–483  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

470 assert cur.fetchone()[0] == t
471
472 def test_autocommit(self):
473 con = self.connect()
474 self.assertFalse(con.get_autocommit())
475
476 cur = con.cursor()
477 cur.execute("SET AUTOCOMMIT=1")
478 self.assertTrue(con.get_autocommit())
479
480 con.autocommit(False)
481 self.assertFalse(con.get_autocommit())
482 cur.execute("SELECT @@AUTOCOMMIT")
483 self.assertEqual(cur.fetchone()[0], 0)
484
485 def test_select_db(self):
486 con = self.connect()

Callers

nothing calls this directly

Calls 6

get_autocommitMethod · 0.80
cursorMethod · 0.80
executeMethod · 0.80
autocommitMethod · 0.80
connectMethod · 0.45
fetchoneMethod · 0.45

Tested by

no test coverage detected