MCPcopy Index your code
hub / github.com/davispuh/MySQL-for-Python-3 / test_close

Method test_close

tests/dbapi20.py:350–366  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

348 con.close()
349
350 def test_close(self):
351 con = self._connect()
352 try:
353 cur = con.cursor()
354 finally:
355 con.close()
356
357 # cursor.execute should raise an Error if called after connection
358 # closed
359 self.assertRaises(self.driver.Error,self.executeDDL1,cur)
360
361 # connection.commit should raise an Error if called after connection'
362 # closed.'
363 self.assertRaises(self.driver.Error,con.commit)
364
365 # connection.close should raise an Error if called more than once
366 self.assertRaises(self.driver.Error,con.close)
367
368 def test_execute(self):
369 con = self._connect()

Callers

nothing calls this directly

Calls 3

_connectMethod · 0.95
cursorMethod · 0.80
closeMethod · 0.80

Tested by

no test coverage detected