From 04979b29bc5567cbb1fb45f32cc881f46b17eada Mon Sep 17 00:00:00 2001 From: Leszek Hanusz Date: Tue, 30 Jun 2026 13:21:23 +0200 Subject: [PATCH] Bump mypy to 2.1.0 --- setup.py | 2 +- tests/custom_scalars/test_money.py | 6 +++++- tests/test_graphql_request.py | 6 +++++- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/setup.py b/setup.py index 2f200b20..857221f5 100644 --- a/setup.py +++ b/setup.py @@ -30,7 +30,7 @@ "check-manifest>=0.42,<1", "flake8==7.3.0", "isort==6.0.1", - "mypy==1.15", + "mypy==2.1.0", "sphinx>=8.1.0,<9", "sphinx_rtd_theme>=3.0.2,<4", "sphinx-argparse==0.5.2; python_version>='3.10'", diff --git a/tests/custom_scalars/test_money.py b/tests/custom_scalars/test_money.py index 3621bad8..8b3971e5 100644 --- a/tests/custom_scalars/test_money.py +++ b/tests/custom_scalars/test_money.py @@ -61,7 +61,11 @@ def parse_money_value(input_value: Any) -> Money: amount = input_value.get("amount", None) currency = input_value.get("currency", None) - if not is_finite(amount) or not isinstance(currency, str): + if ( + not isinstance(amount, (int, float)) + or not is_finite(amount) + or not isinstance(currency, str) + ): raise GraphQLError("Cannot parse money value dict: " + inspect(input_value)) return Money(float(amount), currency) diff --git a/tests/test_graphql_request.py b/tests/test_graphql_request.py index d6ba30d2..5f844681 100644 --- a/tests/test_graphql_request.py +++ b/tests/test_graphql_request.py @@ -57,7 +57,11 @@ def parse_money_value(input_value: Any) -> Money: amount = input_value.get("amount", None) currency = input_value.get("currency", None) - if not is_finite(amount) or not isinstance(currency, str): + if ( + not isinstance(amount, (int, float)) + or not is_finite(amount) + or not isinstance(currency, str) + ): raise GraphQLError("Cannot parse money value dict: " + inspect(input_value)) return Money(float(amount), currency)