# HG changeset patch # User stuart # Date 1411168455 21600 # Fri Sep 19 17:14:15 2014 -0600 # Node ID 365f2a26c1d3526656f78e59b40c0aac589bcf93 # Parent 6af032033c0dabe54657c9075beb6ca0f78bb5e0 Fix failing test: testConcurrentRepeatableRead Test expects to raise an exception, but the exception resulted in the database connection not being closed. That caused a failure to clean up the database and resulted in this and subsequent tests to also fail with the error: OperationalError: database "rounduptest" is being accessed by other users DETAIL: There is 1 other session using the database. diff -r 6af032033c0d -r 365f2a26c1d3 test/test_postgresql.py --- a/test/test_postgresql.py Fri Sep 19 16:54:01 2014 -0600 +++ b/test/test_postgresql.py Fri Sep 19 17:14:15 2014 -0600 @@ -101,9 +101,15 @@ db1.commit() db1.close() - db2.issue.set (id, title='t2') - db2.commit() - db2.close() + # Test testConcurrentRepeatableRead is expected to raise + # an error when the db2.issue.set() call is executed. + try: + db2.issue.set (id, title='t2') + db2.commit() + finally: + # Make sure that the db2 connection is closed, even when + # an error is raised. + db2.close() self.db = self.tracker.open('admin') journal = self.db.getjournal('issue', id) for n, line in enumerate(journal):