diff options
-rwxr-xr-x | tests/test_connection.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/tests/test_connection.py b/tests/test_connection.py index 8236801..af2c3c4 100755 --- a/tests/test_connection.py +++ b/tests/test_connection.py @@ -567,9 +567,11 @@ class IsolationLevelsTestCase(ConnectingTestCase): cur.execute("drop table isolevel;") except psycopg2.ProgrammingError: conn.rollback() - cur.execute("create table isolevel (id integer);") - conn.commit() - conn.close() + try: + cur.execute("create table isolevel (id integer);") + conn.commit() + finally: + conn.close() def test_isolation_level(self): conn = self.connect() |