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

Method test_close

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

Source from the content-addressed store, hash-verified

344 con.close()
345
346 def test_close(self):
347 con = self._connect()
348 try:
349 cur = con.cursor()
350 finally:
351 con.close()
352
353 # cursor.execute should raise an Error if called after connection
354 # closed
355 self.assertRaises(self.driver.Error, self.executeDDL1, cur)
356
357 # connection.commit should raise an Error if called after connection'
358 # closed.'
359 self.assertRaises(self.driver.Error, con.commit)
360
361 # connection.close should raise an Error if called more than once
362 self.assertRaises(self.driver.Error, con.close)
363
364 def test_execute(self):
365 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