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

Method tearDown

tests/dbapi20.py:118–135  ·  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

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