Enable pylint consider-math-not-float check (#154338)

This commit is contained in:
Marc Mueller
2025-10-13 21:14:57 +02:00
committed by GitHub
parent 82c536a4e9
commit 1e5f5f4ad3
11 changed files with 31 additions and 22 deletions

View File

@@ -5,6 +5,7 @@ from __future__ import annotations
from collections.abc import Generator
from datetime import UTC, date, datetime
from decimal import Decimal
import math
from typing import Any
from unittest.mock import patch
@@ -2313,9 +2314,11 @@ async def test_state_classes_with_invalid_unit_of_measurement(
(datetime(2012, 11, 10, 7, 35, 1), "non-numeric"),
(date(2012, 11, 10), "non-numeric"),
("inf", "non-finite"),
(float("inf"), "non-finite"),
(math.inf, "non-finite"),
(float("inf"), "non-finite"), # pylint: disable=consider-math-not-float
("nan", "non-finite"),
(float("nan"), "non-finite"),
(math.nan, "non-finite"),
(float("nan"), "non-finite"), # pylint: disable=consider-math-not-float
],
)
async def test_non_numeric_validation_error(