MCPcopy
hub / github.com/PyMySQL/PyMySQL / test_init_command

Method test_init_command

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

Source from the content-addressed store, hash-verified

511 self.assertIn(cm.exception.args[0], (2006, 2013))
512
513 def test_init_command(self):
514 conn = self.connect(
515 init_command='SELECT "bar"; SELECT "baz"',
516 client_flag=CLIENT.MULTI_STATEMENTS,
517 )
518 c = conn.cursor()
519 c.execute('select "foobar";')
520 self.assertEqual(("foobar",), c.fetchone())
521 conn.close()
522 with self.assertRaises(pymysql.err.Error):
523 conn.ping(reconnect=False)
524
525 def test_read_default_group(self):
526 conn = self.connect(

Callers

nothing calls this directly

Calls 6

cursorMethod · 0.80
executeMethod · 0.80
pingMethod · 0.80
connectMethod · 0.45
fetchoneMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected