]> git.ipfire.org Git - thirdparty/psycopg.git/commitdiff
Run leak tests with both text and binary output
authorDaniele Varrazzo <daniele.varrazzo@gmail.com>
Fri, 5 Mar 2021 17:46:30 +0000 (18:46 +0100)
committerDaniele Varrazzo <daniele.varrazzo@gmail.com>
Fri, 5 Mar 2021 17:46:30 +0000 (18:46 +0100)
At the moment the output text is actually skipped but it will run once
text input is no more xfailed.

tests/test_cursor.py
tests/test_cursor_async.py

index 73adf7204933dfe261d33c0f1b126c17c08f0efb..7d3f935e58937e39cc7e5f983faddb046812dbde 100644 (file)
@@ -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)
index b41803b50d24eea8c97a7786751d3799c0c55d72..8ab2195e1a61c71ae7c7d210196e795b89919380 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=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)