]> git.ipfire.org Git - thirdparty/psycopg.git/commitdiff
Use a different iter variable in test_evict_lru_deallocate()
authorDenis Laxalde <denis.laxalde@dalibo.com>
Fri, 5 Nov 2021 08:33:02 +0000 (09:33 +0100)
committerDaniele Varrazzo <daniele.varrazzo@gmail.com>
Wed, 10 Nov 2021 01:57:39 +0000 (02:57 +0100)
Resolves mypy error:
  error: Incompatible types in assignment (expression has type "object", variable has type "int")  [assignment]
And makes test_prepared*.py mypy clean.

pyproject.toml
tests/test_prepared.py
tests/test_prepared_async.py

index 42c7e27f4a22ea3a078716bef2cd089dd3a457ed..b38ceb66f8a61a8f8a5c4fdcfec1672d9efce42e 100644 (file)
@@ -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",
index af4c51fc85b7604ce848cf980d9c4a6ebbef1f1b..ef7b7ee4eb8e26d270fc762ae0937d53cf4dfed3 100644 (file)
@@ -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(
index dc139c1d9bd1df529cc4fb852c53f0e5d21d9670..b3477bc5265a1a238ab5c9ec4e8a9d5848f72ce3 100644 (file)
@@ -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(