From: Denis Laxalde Date: Tue, 2 Mar 2021 11:12:31 +0000 (+0100) Subject: Fix binary argument of conn.cursor() in tests X-Git-Tag: 3.0.dev0~96 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fc6a850f806072a1185451fcb0fce49dbbb6731c;p=thirdparty%2Fpsycopg.git 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'). --- 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)