Skip to content

Commit

Permalink
fix isolation level test
Browse files Browse the repository at this point in the history
  • Loading branch information
vgvoleg committed Oct 23, 2024
1 parent 47cce3a commit 7ba4f03
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tests/test_connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ async def _test_isolation_level_read_only(
isolation_level: str,
read_only: bool,
) -> None:
connection.set_isolation_level("AUTOCOMMIT")
async with connection.cursor() as cursor:
with suppress(dbapi.DatabaseError):
await cursor.execute("DROP TABLE foo")
Expand All @@ -39,6 +40,8 @@ async def _test_isolation_level_read_only(

await connection.rollback()

connection.set_isolation_level("AUTOCOMMIT")

async with connection.cursor() as cursor:
await cursor.execute("DROP TABLE foo")

Expand Down

0 comments on commit 7ba4f03

Please sign in to comment.