Skip to content

Commit e6a9c31

Browse files
authored
Bump mypy to 2.1.0 (#604)
1 parent 8b20ef6 commit e6a9c31

3 files changed

Lines changed: 11 additions & 3 deletions

File tree

‎setup.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
"check-manifest>=0.42,<1",
3131
"flake8==7.3.0",
3232
"isort==6.0.1",
33-
"mypy==1.15",
33+
"mypy==2.1.0",
3434
"sphinx>=8.1.0,<9",
3535
"sphinx_rtd_theme>=3.0.2,<4",
3636
"sphinx-argparse==0.5.2; python_version>='3.10'",

‎tests/custom_scalars/test_money.py‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,11 @@ def parse_money_value(input_value: Any) -> Money:
6161
amount = input_value.get("amount", None)
6262
currency = input_value.get("currency", None)
6363

64-
if not is_finite(amount) or not isinstance(currency, str):
64+
if (
65+
not isinstance(amount, (int, float))
66+
or not is_finite(amount)
67+
or not isinstance(currency, str)
68+
):
6569
raise GraphQLError("Cannot parse money value dict: " + inspect(input_value))
6670

6771
return Money(float(amount), currency)

‎tests/test_graphql_request.py‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,11 @@ def parse_money_value(input_value: Any) -> Money:
5757
amount = input_value.get("amount", None)
5858
currency = input_value.get("currency", None)
5959

60-
if not is_finite(amount) or not isinstance(currency, str):
60+
if (
61+
not isinstance(amount, (int, float))
62+
or not is_finite(amount)
63+
or not isinstance(currency, str)
64+
):
6165
raise GraphQLError("Cannot parse money value dict: " + inspect(input_value))
6266

6367
return Money(float(amount), currency)

0 commit comments

Comments
 (0)