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

Method tearDown

tests/dbapi20.py:117–134  ·  view source on GitHub ↗

self.drivers should override this method to perform required cleanup if any is necessary, such as deleting the test database. The default drops the tables that may be created.

(self)

Source from the content-addressed store, hash-verified

115 pass
116
117 def tearDown(self):
118 ''' self.drivers should override this method to perform required cleanup
119 if any is necessary, such as deleting the test database.
120 The default drops the tables that may be created.
121 '''
122 con = self._connect()
123 try:
124 cur = con.cursor()
125 for ddl in (self.xddl1,self.xddl2):
126 try:
127 cur.execute(ddl)
128 con.commit()
129 except self.driver.Error:
130 # Assume table didn't exist. Other tests will check if
131 # execute is busted.
132 pass
133 finally:
134 con.close()
135
136 def _connect(self):
137 try:

Callers

nothing calls this directly

Calls 4

_connectMethod · 0.95
cursorMethod · 0.80
executeMethod · 0.80
closeMethod · 0.80

Tested by

no test coverage detected