mirror of
https://github.com/psycopg/psycopg2.git
synced 2024-11-22 08:56:34 +03:00
Merge pull request #1127 from rafiss/iso-level-finally-block
Handle failure in setup of IsolationLevelsTestCase
This commit is contained in:
commit
cecff195fc
|
@ -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()
|
||||
|
|
Loading…
Reference in New Issue
Block a user