psycopg.git / summary / log / commit / refs

commit    fa2cd2416aba354d9aae1d707406b1b656fa49df
Author:   Daniele Varrazzo <daniele.varrazzo@gmail.com>
Date:     Fri Mar 05 17:46:30 2021 +0000

    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.


tests/test_cursor.py | 4 +++- tests/test_cursor_async.py | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/test_cursor.py b/tests/test_cursor.py index 73adf720..7d3f935e 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 b41803b5..8ab2195e 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) [parent: fc6a850f8060]