test: drop test table if exist

It might be a residue of a psycopg 3 test run in the same db.
This commit is contained in:
Daniele Varrazzo 2022-07-16 23:57:58 +01:00
parent c34bf2f2f9
commit ba92a22bc9

View File

@ -379,6 +379,12 @@ class CursorTests(ConnectingTestCase):
@skip_before_postgres(8, 2)
def test_rowcount_on_executemany_returning(self):
cur = self.conn.cursor()
try:
cur.execute("drop table execmany")
self.conn.commit()
except psycopg2.DatabaseError:
self.conn.rollback()
cur.execute("create table execmany(id serial primary key, data int)")
cur.executemany(
"insert into execmany (data) values (%s)",