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