]> git.ipfire.org Git - thirdparty/psycopg.git/commitdiff
test: add missing returning=True to executemany() in pipeline tests
authorDenis Laxalde <denis.laxalde@dalibo.com>
Tue, 29 Mar 2022 07:00:07 +0000 (09:00 +0200)
committerDaniele Varrazzo <daniele.varrazzo@gmail.com>
Sat, 2 Apr 2022 23:23:22 +0000 (01:23 +0200)
Query in test_executemany() has a returning clause and we fetch results
from cursor after execution, so it seems the returning option to
executemany() is needed. These tests probably do not fail because of the
TODO in Cursor._set_results_from_pipeline().

tests/test_pipeline.py
tests/test_pipeline_async.py

index 62a66acb109561dddc599d330dd51b1d38ebcdf9..c5e3a37cdd4c403a1c8340a551df820511edd21b 100644 (file)
@@ -167,6 +167,7 @@ def test_executemany(conn):
         cur.executemany(
             "insert into execmanypipeline(num) values (%s) returning id",
             [(10,), (20,)],
+            returning=True,
         )
         assert cur.fetchone() == (1,)
         assert cur.nextset()
index c7ce2df94783539c617b5f89a4136ef71918e0b1..ba4065821603d740ec35acb207046eded990a1bd 100644 (file)
@@ -170,6 +170,7 @@ async def test_executemany(aconn):
         await cur.executemany(
             "insert into execmanypipeline(num) values (%s) returning id",
             [(10,), (20,)],
+            returning=True,
         )
         assert (await cur.fetchone()) == (1,)
         assert cur.nextset()