From: Daniele Varrazzo Date: Wed, 24 Jul 2024 09:10:10 +0000 (+0200) Subject: chore: bump mypy X-Git-Tag: 3.2.2~11 X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=c57be97d60e23d00c51b30fd7506cf9ddf354866;p=thirdparty%2Fpsycopg.git chore: bump mypy --- diff --git a/psycopg/setup.cfg b/psycopg/setup.cfg index 6ac1b3fa3..9de886908 100644 --- a/psycopg/setup.cfg +++ b/psycopg/setup.cfg @@ -67,7 +67,7 @@ pool = psycopg-pool test = anyio >= 4.0 - mypy >= 1.6 + mypy >= 1.11 pproxy >= 2.7 pytest >= 6.2.5 pytest-cov >= 3.0 @@ -78,7 +78,7 @@ dev = codespell >= 2.2 dnspython >= 2.1 flake8 >= 4.0 - mypy >= 1.6 + mypy >= 1.11 types-setuptools >= 57.4 wheel >= 0.37 docs = diff --git a/tests/constraints.txt b/tests/constraints.txt index 22fe8337d..1ff490ef2 100644 --- a/tests/constraints.txt +++ b/tests/constraints.txt @@ -10,7 +10,7 @@ importlib-metadata == 1.4 # From the 'test' extra anyio == 4.0 -mypy == 1.6.0 +mypy == 1.11.0 pproxy == 2.7.0 pytest == 6.2.5 pytest-cov == 3.0.0 diff --git a/tests/test_cursor_server.py b/tests/test_cursor_server.py index bf990a030..30a6a5e35 100644 --- a/tests/test_cursor_server.py +++ b/tests/test_cursor_server.py @@ -37,7 +37,7 @@ def test_init_row_factory(conn): with psycopg.ServerCursor(conn, "baz", row_factory=rows.namedtuple_row) as cur: assert cur.name == "baz" - assert cur.row_factory is rows.namedtuple_row # type: ignore + assert cur.row_factory is rows.namedtuple_row def test_init_params(conn): diff --git a/tests/test_cursor_server_async.py b/tests/test_cursor_server_async.py index 348dc2f66..92b669405 100644 --- a/tests/test_cursor_server_async.py +++ b/tests/test_cursor_server_async.py @@ -38,7 +38,7 @@ async def test_init_row_factory(aconn): aconn, "baz", row_factory=rows.namedtuple_row ) as cur: assert cur.name == "baz" - assert cur.row_factory is rows.namedtuple_row # type: ignore + assert cur.row_factory is rows.namedtuple_row async def test_init_params(aconn): diff --git a/tests/types/test_enum.py b/tests/types/test_enum.py index e40c61025..482b5879b 100644 --- a/tests/types/test_enum.py +++ b/tests/types/test_enum.py @@ -306,7 +306,8 @@ def test_remap(conn, fmt_in, fmt_out, mapping): def test_remap_rename(conn): - enum = Enum("RenamedEnum", "FOO BAR QUX") + RenamedEnum = Enum("RenamedEnum", "FOO BAR QUX") + enum = RenamedEnum info = EnumInfo.fetch(conn, "puretestenum") register_enum(info, conn, enum, mapping={enum.QUX: "BAZ"}) @@ -318,7 +319,8 @@ def test_remap_rename(conn): def test_remap_more_python(conn): - enum = Enum("LargerEnum", "FOO BAR BAZ QUX QUUX QUUUX") + LargerEnum = Enum("LargerEnum", "FOO BAR BAZ QUX QUUX QUUUX") + enum = LargerEnum info = EnumInfo.fetch(conn, "puretestenum") mapping = {enum[m]: "BAZ" for m in ["QUX", "QUUX", "QUUUX"]} register_enum(info, conn, enum, mapping=mapping) @@ -333,7 +335,8 @@ def test_remap_more_python(conn): def test_remap_more_postgres(conn): - enum = Enum("SmallerEnum", "FOO") + SmallerEnum = Enum("SmallerEnum", "FOO") + enum = SmallerEnum info = EnumInfo.fetch(conn, "puretestenum") mapping = [(enum.FOO, "BAR"), (enum.FOO, "BAZ")] register_enum(info, conn, enum, mapping=mapping)