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)
| 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: |