From: Daniele Varrazzo Date: Thu, 28 Jul 2022 09:26:49 +0000 (+0200) Subject: test: add tests to reveal the rowcount problem with SHOW X-Git-Tag: 3.1~41^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d17b0d8b11d66822d2166f00c9a730edfe79ca93;p=thirdparty%2Fpsycopg.git test: add tests to reveal the rowcount problem with SHOW See #343 --- diff --git a/tests/test_cursor.py b/tests/test_cursor.py index 797a539fa..75af433cb 100644 --- a/tests/test_cursor.py +++ b/tests/test_cursor.py @@ -393,6 +393,9 @@ def test_rowcount(conn): cur.execute("select 1 from generate_series(1, 42)") assert cur.rowcount == 42 + cur.execute("show timezone") + assert cur.rowcount == 1 + cur.execute("create table test_rowcount_notuples (id int primary key)") assert cur.rowcount == -1 diff --git a/tests/test_cursor_async.py b/tests/test_cursor_async.py index 0af43daca..741eba3d9 100644 --- a/tests/test_cursor_async.py +++ b/tests/test_cursor_async.py @@ -383,6 +383,9 @@ async def test_rowcount(aconn): await cur.execute("select 1 from generate_series(1, 42)") assert cur.rowcount == 42 + await cur.execute("show timezone") + assert cur.rowcount == 1 + await cur.execute("create table test_rowcount_notuples (id int primary key)") assert cur.rowcount == -1