From fc6a850f806072a1185451fcb0fce49dbbb6731c Mon Sep 17 00:00:00 2001 From: Denis Laxalde Date: Tue, 2 Mar 2021 12:12:31 +0100 Subject: [PATCH] Fix binary argument of conn.cursor() in tests Argument 'binary' of connection.cursor() should be a bool. This follows up on 467d20bd0315a62b4c7377d8a0b170ece08ef99c (change from 'format' to 'binary'). --- tests/test_cursor.py | 4 +--- tests/test_cursor_async.py | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/tests/test_cursor.py b/tests/test_cursor.py index 014d61d90..73adf7204 100644 --- a/tests/test_cursor.py +++ b/tests/test_cursor.py @@ -549,9 +549,7 @@ def test_leak(dsn, faker, fmt, fetch, row_factory): n = [] for i in range(3): with psycopg3.connect(dsn) as conn: - with conn.cursor( - binary=Format.as_pq(fmt), row_factory=row_factory - ) as cur: + with conn.cursor(binary=True, row_factory=row_factory) as cur: cur.execute(faker.drop_stmt) cur.execute(faker.create_stmt) cur.executemany(faker.insert_stmt, faker.records) diff --git a/tests/test_cursor_async.py b/tests/test_cursor_async.py index 5b0e542b1..b41803b50 100644 --- a/tests/test_cursor_async.py +++ b/tests/test_cursor_async.py @@ -464,7 +464,7 @@ async def test_leak(dsn, faker, fmt, fetch, row_factory): for i in range(3): async with await psycopg3.AsyncConnection.connect(dsn) as conn: async with conn.cursor( - binary=Format.as_pq(fmt), row_factory=row_factory + binary=True, row_factory=row_factory ) as cur: await cur.execute(faker.drop_stmt) await cur.execute(faker.create_stmt) -- 2.47.2