]> git.ipfire.org Git - thirdparty/psycopg.git/commitdiff
Fix binary argument of conn.cursor() in tests
authorDenis Laxalde <denis.laxalde@dalibo.com>
Tue, 2 Mar 2021 11:12:31 +0000 (12:12 +0100)
committerDaniele Varrazzo <daniele.varrazzo@gmail.com>
Fri, 5 Mar 2021 17:33:50 +0000 (18:33 +0100)
Argument 'binary' of connection.cursor() should be a bool.
This follows up on 467d20bd0315a62b4c7377d8a0b170ece08ef99c (change from
'format' to 'binary').

tests/test_cursor.py
tests/test_cursor_async.py

index 014d61d909b1e7fe618b285ebc06733f4bddfe4d..73adf7204933dfe261d33c0f1b126c17c08f0efb 100644 (file)
@@ -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)
index 5b0e542b1755f1225fac54fa7236e56ca439b6a9..b41803b50d24eea8c97a7786751d3799c0c55d72 100644 (file)
@@ -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)