From: Denis Laxalde Date: Fri, 5 Nov 2021 08:33:02 +0000 (+0100) Subject: Use a different iter variable in test_evict_lru_deallocate() X-Git-Tag: 3.0.3~3^2~21 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4194568790bd743ff1b4ed22f753c6342277e719;p=thirdparty%2Fpsycopg.git Use a different iter variable in test_evict_lru_deallocate() Resolves mypy error: error: Incompatible types in assignment (expression has type "object", variable has type "int") [assignment] And makes test_prepared*.py mypy clean. --- diff --git a/pyproject.toml b/pyproject.toml index 42c7e27f4..b38ceb66f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -25,6 +25,7 @@ files = [ "tests/scripts", "tests/test_conninfo.py", "tests/test_dns*", + "tests/test_prepared*.py", "tests/test_psycopg_dbapi20.py", "tests/test_sql.py", "tests/types", diff --git a/tests/test_prepared.py b/tests/test_prepared.py index af4c51fc8..ef7b7ee4e 100644 --- a/tests/test_prepared.py +++ b/tests/test_prepared.py @@ -157,8 +157,8 @@ def test_evict_lru_deallocate(conn): conn.execute(f"select {i}") assert len(conn._prepared._prepared) == 5 - for i in [9, 8, 7, 6, "'a'"]: - name = conn._prepared._prepared[f"select {i}".encode(), ()] + for j in [9, 8, 7, 6, "'a'"]: + name = conn._prepared._prepared[f"select {j}".encode(), ()] assert name.startswith(b"_pg3_") cur = conn.execute( diff --git a/tests/test_prepared_async.py b/tests/test_prepared_async.py index dc139c1d9..b3477bc52 100644 --- a/tests/test_prepared_async.py +++ b/tests/test_prepared_async.py @@ -165,9 +165,9 @@ async def test_evict_lru_deallocate(aconn): await aconn.execute(f"select {i}") assert len(aconn._prepared._prepared) == 5 - for i in [9, 8, 7, 6, "'a'"]: + for j in [9, 8, 7, 6, "'a'"]: assert aconn._prepared._prepared[ - f"select {i}".encode(), () + f"select {j}".encode(), () ].startswith(b"_pg3_") cur = await aconn.execute(