Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 4 additions & 11 deletions tests/integration/dbapi/async/test_queries_async.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,20 +195,13 @@ async def test_long_query(
assert len(data) == 360, "Invalid data size returned by fetchall"


async def test_drop_create(
connection: Connection, create_drop_description: List[Column]
) -> None:
async def test_drop_create(connection: Connection) -> None:
"""Create and drop table/index queries are handled properly."""

async def test_query(c: Cursor, query: str) -> None:
assert await c.execute(query) == 1, "Invalid row count returned"
assert c.rowcount == 1, "Invalid rowcount value"
assert_deep_eq(
c.description,
create_drop_description,
"Invalid create table query description",
)
assert len(await c.fetchall()) == 1, "Invalid data returned"
await c.execute(query)
assert c.description == None
assert c.rowcount == -1

"""Create table query is handled properly"""
with connection.cursor() as c:
Expand Down
15 changes: 4 additions & 11 deletions tests/integration/dbapi/sync/test_queries.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,20 +146,13 @@ def test_long_query(
assert len(data) == 360, "Invalid data size returned by fetchall"


def test_drop_create(
connection: Connection, create_drop_description: List[Column]
) -> None:
def test_drop_create(connection: Connection) -> None:
"""Create and drop table/index queries are handled properly."""

def test_query(c: Cursor, query: str) -> None:
assert c.execute(query) == 1, "Invalid row count returned"
assert c.rowcount == 1, "Invalid rowcount value"
assert_deep_eq(
c.description,
create_drop_description,
"Invalid create table query description",
)
assert len(c.fetchall()) == 1, "Invalid data returned"
c.execute(query)
assert c.description == None
assert c.rowcount == -1

"""Create table query is handled properly"""
with connection.cursor() as c:
Expand Down