From: Daniele Varrazzo Date: Fri, 5 Mar 2021 17:46:30 +0000 (+0100) Subject: Run leak tests with both text and binary output X-Git-Tag: 3.0.dev0~95 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fa2cd2416aba354d9aae1d707406b1b656fa49df;p=thirdparty%2Fpsycopg.git Run leak tests with both text and binary output At the moment the output text is actually skipped but it will run once text input is no more xfailed. --- diff --git a/tests/test_cursor.py b/tests/test_cursor.py index 73adf7204..7d3f935e5 100644 --- a/tests/test_cursor.py +++ b/tests/test_cursor.py @@ -549,7 +549,9 @@ 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=True, row_factory=row_factory) as cur: + with conn.cursor( + binary=fmt == Format.BINARY, 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 b41803b50..8ab2195e1 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=True, row_factory=row_factory + binary=fmt == Format.BINARY, row_factory=row_factory ) as cur: await cur.execute(faker.drop_stmt) await cur.execute(faker.create_stmt)