From: Daniele Varrazzo Date: Thu, 19 May 2022 21:41:26 +0000 (+0200) Subject: Test: fix mypy 0.941 run X-Git-Tag: 3.1~80 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d05815a046d202c33a114bf0843d73cf18321555;p=thirdparty%2Fpsycopg.git Test: fix mypy 0.941 run This seems a mypy shortcoming fixed in 0.950 as the CI didn't complain. The row factory definition was exotic but arguably correct. Not worth bumping up the min version for it anyway. --- diff --git a/tests/test_connection.py b/tests/test_connection.py index bdd3117b7..58c655634 100644 --- a/tests/test_connection.py +++ b/tests/test_connection.py @@ -508,7 +508,7 @@ def test_row_factory(dsn): cur = conn.execute("select 'a' as ve") assert cur.fetchone() == ["Ave"] - with conn.cursor(row_factory=lambda c: set) as cur1: + with conn.cursor(row_factory=lambda c: lambda t: set(t)) as cur1: cur1.execute("select 1, 1, 2") assert cur1.fetchall() == [{1, 2}] diff --git a/tests/test_connection_async.py b/tests/test_connection_async.py index 8d48ed69e..93ee762f5 100644 --- a/tests/test_connection_async.py +++ b/tests/test_connection_async.py @@ -513,7 +513,7 @@ async def test_row_factory(dsn): cur = await conn.execute("select 'a' as ve") assert await cur.fetchone() == ["Ave"] - async with conn.cursor(row_factory=lambda c: set) as cur1: + async with conn.cursor(row_factory=lambda c: lambda t: set(t)) as cur1: await cur1.execute("select 1, 1, 2") assert await cur1.fetchall() == [{1, 2}]