Wrapped the 'test_statement_prepare_error' test inside of a transaction, that leaves the database in a clean state after the `rhnSQL.SQLStatementPrepareError` exception is raised. --- backend/test/non-unit/server/rhnSQL/dbtests.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/backend/test/non-unit/server/rhnSQL/dbtests.py b/backend/test/non-unit/server/rhnSQL/dbtests.py index 1be2c77..32f722e 100644 --- a/backend/test/non-unit/server/rhnSQL/dbtests.py +++ b/backend/test/non-unit/server/rhnSQL/dbtests.py @@ -69,11 +69,14 @@ class RhnSQLDatabaseTests(unittest.TestCase): self.assertRaises(sql_base.SQLError, cursor.execute, name="Blah") def test_statement_prepare_error(self): + rhnSQL.transaction("test_statement_prepare_error") + query = "aaa bbb ccc" cursor = rhnSQL.prepare(query) self.assertRaises(rhnSQL.SQLStatementPrepareError, cursor.execute) - rhnSQL.rollback() + + rhnSQL.rollback("test_statement_prepare_error") def test_execute_bindbyname_extra_params_passed(self): query = "SELECT * FROM %s WHERE id = :id" % self.temp_table -- 1.8.1.4 _______________________________________________ Spacewalk-devel mailing list Spacewalk-devel@redhat.com https://www.redhat.com/mailman/listinfo/spacewalk-devel