Skip to content

Commit

Permalink
Bump version
Browse files Browse the repository at this point in the history
  • Loading branch information
MatthewFlamm committed Jan 6, 2024
1 parent 10463ef commit f223b32
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 16 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# pytest-homeassistant-custom-component

![HA core version](https://img.shields.io/static/v1?label=HA+core+version&message=2024.1.0&labelColor=blue)
![HA core version](https://img.shields.io/static/v1?label=HA+core+version&message=2024.1.2&labelColor=blue)

[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/MatthewFlamm/pytest-homeassistant-custom-component)

Expand Down
2 changes: 1 addition & 1 deletion ha_version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2024.1.0
2024.1.2
2 changes: 1 addition & 1 deletion requirements_test.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ requests-mock==1.11.0
respx==0.20.2
syrupy==4.6.0
tqdm==4.66.1
homeassistant==2024.1.0
homeassistant==2024.1.2
SQLAlchemy==2.0.23

paho-mqtt==1.6.1
Expand Down
14 changes: 12 additions & 2 deletions src/pytest_homeassistant_custom_component/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@
import homeassistant.util.yaml.loader as yaml_loader

from .testing_config.custom_components.test_constant_deprecation import (
import_deprecated_costant,
import_deprecated_constant,
)

_LOGGER = logging.getLogger(__name__)
Expand Down Expand Up @@ -1488,6 +1488,7 @@ def import_and_test_deprecated_constant_enum(
- Assert value is the same as the replacement
- Assert a warning is logged
- Assert the deprecated constant is included in the modules.__dir__()
- Assert the deprecated constant is included in the modules.__all__()
"""
import_and_test_deprecated_constant(
caplog,
Expand All @@ -1513,8 +1514,9 @@ def import_and_test_deprecated_constant(
- Assert value is the same as the replacement
- Assert a warning is logged
- Assert the deprecated constant is included in the modules.__dir__()
- Assert the deprecated constant is included in the modules.__all__()
"""
value = import_deprecated_costant(module, constant_name)
value = import_deprecated_constant(module, constant_name)
assert value == replacement
assert (
module.__name__,
Expand All @@ -1529,3 +1531,11 @@ def import_and_test_deprecated_constant(

# verify deprecated constant is included in dir()
assert constant_name in dir(module)
assert constant_name in module.__all__


def help_test_all(module: ModuleType) -> None:
"""Test module.__all__ is correctly set."""
assert set(module.__all__) == {
itm for itm in module.__dir__() if not itm.startswith("_")
}
11 changes: 2 additions & 9 deletions src/pytest_homeassistant_custom_component/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,9 @@
This file is originally from homeassistant/core and modified by pytest-homeassistant-custom-component.
"""
from __future__ import annotations

from enum import StrEnum
from typing import Any, Final

APPLICATION_NAME: Final = "HomeAssistant"
from typing import Final
MAJOR_VERSION: Final = 2024
MINOR_VERSION: Final = 1
PATCH_VERSION: Final = "0"
PATCH_VERSION: Final = "2"
__short_version__: Final = f"{MAJOR_VERSION}.{MINOR_VERSION}"
__version__: Final = f"{__short_version__}.{PATCH_VERSION}"
REQUIRED_PYTHON_VER: Final[tuple[int, int, int]] = (3, 11, 0)
REQUIRED_NEXT_PYTHON_VER: Final[tuple[int, int, int]] = (3, 11, 0)
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
from typing import Any


def import_deprecated_costant(module: ModuleType, constant_name: str) -> Any:
def import_deprecated_constant(module: ModuleType, constant_name: str) -> Any:
"""Import and return deprecated constant."""
return getattr(module, constant_name)
2 changes: 1 addition & 1 deletion version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.13.87
0.13.88

0 comments on commit f223b32

Please sign in to comment.