File tree Expand file tree Collapse file tree 2 files changed +1
-41
lines changed Expand file tree Collapse file tree 2 files changed +1
-41
lines changed Original file line number Diff line number Diff line change @@ -685,13 +685,6 @@ class UnitOfArea(StrEnum):
685685 HECTARES = "ha"
686686
687687
688- _DEPRECATED_AREA_SQUARE_METERS : Final = DeprecatedConstantEnum (
689- UnitOfArea .SQUARE_METERS ,
690- "2025.12" ,
691- )
692- """Deprecated: please use UnitOfArea.SQUARE_METERS"""
693-
694-
695688# Mass units
696689class UnitOfMass (StrEnum ):
697690 """Mass units."""
Original file line number Diff line number Diff line change 11"""Test const module."""
22
3- from enum import Enum
4-
5- import pytest
6-
73from homeassistant import const
84
9- from .common import help_test_all , import_and_test_deprecated_constant
10-
11-
12- def _create_tuples (
13- value : type [Enum ] | list [Enum ], constant_prefix : str
14- ) -> list [tuple [Enum , str ]]:
15- return [(enum , constant_prefix ) for enum in value ]
5+ from .common import help_test_all
166
177
188def test_all () -> None :
199 """Test module.__all__ is correctly set."""
2010 help_test_all (const )
21-
22-
23- @pytest .mark .parametrize (
24- ("replacement" , "constant_name" , "breaks_in_version" ),
25- [
26- (const .UnitOfArea .SQUARE_METERS , "AREA_SQUARE_METERS" , "2025.12" ),
27- ],
28- )
29- def test_deprecated_constant_name_changes (
30- caplog : pytest .LogCaptureFixture ,
31- replacement : Enum ,
32- constant_name : str ,
33- breaks_in_version : str ,
34- ) -> None :
35- """Test deprecated constants, where the name is not the same as the enum value."""
36- import_and_test_deprecated_constant (
37- caplog ,
38- const ,
39- constant_name ,
40- f"{ replacement .__class__ .__name__ } .{ replacement .name } " ,
41- replacement ,
42- breaks_in_version ,
43- )
You can’t perform that action at this time.
0 commit comments