mirror of
https://github.com/psycopg/psycopg2.git
synced 2024-11-22 17:06:33 +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;")
|
cur.execute("drop table isolevel;")
|
||||||
except psycopg2.ProgrammingError:
|
except psycopg2.ProgrammingError:
|
||||||
conn.rollback()
|
conn.rollback()
|
||||||
cur.execute("create table isolevel (id integer);")
|
try:
|
||||||
conn.commit()
|
cur.execute("create table isolevel (id integer);")
|
||||||
conn.close()
|
conn.commit()
|
||||||
|
finally:
|
||||||
|
conn.close()
|
||||||
|
|
||||||
def test_isolation_level(self):
|
def test_isolation_level(self):
|
||||||
conn = self.connect()
|
conn = self.connect()
|
||||||
|
|
Loading…
Reference in New Issue
Block a user