From: Denis Laxalde Date: Tue, 29 Mar 2022 07:00:07 +0000 (+0200) Subject: test: add missing returning=True to executemany() in pipeline tests X-Git-Tag: 3.1~145^2~13 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d27d4338b186a24e4cc2a5a691250301dde723d4;p=thirdparty%2Fpsycopg.git test: add missing returning=True to executemany() in pipeline tests 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(). --- diff --git a/tests/test_pipeline.py b/tests/test_pipeline.py index 62a66acb1..c5e3a37cd 100644 --- a/tests/test_pipeline.py +++ b/tests/test_pipeline.py @@ -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() diff --git a/tests/test_pipeline_async.py b/tests/test_pipeline_async.py index c7ce2df94..ba4065821 100644 --- a/tests/test_pipeline_async.py +++ b/tests/test_pipeline_async.py @@ -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()