From: Daniele Varrazzo Date: Sat, 12 Jul 2025 05:08:45 +0000 (+0200) Subject: test: fix results() test X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=87811ea3afab78de7e18e252eb0d3292edc94d56;p=thirdparty%2Fpsycopg.git test: fix results() test Test a server-side cursor for real, drop unneeded parametrization. --- diff --git a/tests/test_cursor_server.py b/tests/test_cursor_server.py index a22571cce..cd680b29a 100644 --- a/tests/test_cursor_server.py +++ b/tests/test_cursor_server.py @@ -583,8 +583,7 @@ def test_row_maker_returns_none(conn): assert list(stream) == recs -@pytest.mark.parametrize("count", [1]) -def test_results_after_execute(conn, count): - with conn.cursor() as cur: - cur.execute(";".join(["select 1"] * count)) - assert list(cur.results()) == [cur] * count +def test_results_after_execute(conn): + with conn.cursor("test") as cur: + cur.execute("select 1") + assert list(cur.results()) == [cur] diff --git a/tests/test_cursor_server_async.py b/tests/test_cursor_server_async.py index 8bfb5ac44..5a56b2c13 100644 --- a/tests/test_cursor_server_async.py +++ b/tests/test_cursor_server_async.py @@ -589,8 +589,7 @@ async def test_row_maker_returns_none(aconn): assert await alist(stream) == recs -@pytest.mark.parametrize("count", [1]) -async def test_results_after_execute(aconn, count): - async with aconn.cursor() as cur: - await cur.execute(";".join(["select 1"] * count)) - assert await alist(cur.results()) == [cur] * count +async def test_results_after_execute(aconn): + async with aconn.cursor("test") as cur: + await cur.execute("select 1") + assert await alist(cur.results()) == [cur]