Skip to content

Commit

Permalink
Bump version
Browse files Browse the repository at this point in the history
  • Loading branch information
MatthewFlamm committed Jul 30, 2023
1 parent 99f7d7e commit f394aae
Show file tree
Hide file tree
Showing 7 changed files with 39 additions and 27 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=2023.7.3&labelColor=blue)
![HA core version](https://img.shields.io/static/v1?label=HA+core+version&message=2023.8.0b1&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 @@
2023.7.3
2023.8.0b1
3 changes: 1 addition & 2 deletions requirements_dev.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# This file is originally from homeassistant/core and modified by pytest-homeassistant-custom-component.
astroid==2.15.4
mypy==1.4.1
pre-commit==3.1.0
pre-commit==3.3.3
pylint==2.17.4
types-atomicwrites==1.4.5.1
types-croniter==1.0.6
Expand All @@ -17,4 +17,3 @@ types-python-slugify==0.1.2
types-pytz==2023.3.0.0
types-PyYAML==6.0.12.2
types-requests==2.31.0.1
types-toml==0.10.8.6
29 changes: 14 additions & 15 deletions requirements_test.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,30 +8,29 @@

-c homeassistant/package_constraints.txt
-r requirements_test_pre_commit.txt
coverage==7.2.4
coverage==7.2.7
freezegun==1.2.2
mock-open==1.4.0
pydantic==1.10.9
pylint-per-file-ignores==1.1.0
pipdeptree==2.7.0
pytest-asyncio==0.20.3
pydantic==1.10.11
pylint-per-file-ignores==1.2.1
pipdeptree==2.11.0
pytest-asyncio==0.21.0
pytest-aiohttp==1.0.4
pytest-cov==3.0.0
pytest-freezer==0.4.6
pytest-socket==0.5.1
pytest-cov==4.1.0
pytest-freezer==0.4.8
pytest-socket==0.6.0
pytest-test-groups==1.0.3
pytest-sugar==0.9.6
pytest-sugar==0.9.7
pytest-timeout==2.1.0
pytest-unordered==0.5.2
pytest-picked==0.4.6
pytest-xdist==3.2.1
pytest-xdist==3.3.1
pytest==7.3.1
requests_mock==1.11.0
respx==0.20.1
syrupy==4.0.2
tomli==2.0.1;python_version<"3.11"
tqdm==4.64.0
homeassistant==2023.7.3
respx==0.20.2
syrupy==4.0.8
tqdm==4.65.0
homeassistant==2023.8.0b1
SQLAlchemy==2.0.15

paho-mqtt==1.6.1
Expand Down
9 changes: 5 additions & 4 deletions src/pytest_homeassistant_custom_component/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,14 @@
"""
from __future__ import annotations

from enum import StrEnum
from typing import Final


APPLICATION_NAME: Final = "HomeAssistant"
MAJOR_VERSION: Final = 2023
MINOR_VERSION: Final = 7
PATCH_VERSION: Final = "3"
MINOR_VERSION: Final = 8
PATCH_VERSION: Final = "0b1"
__short_version__: Final = f"{MAJOR_VERSION}.{MINOR_VERSION}"
__version__: Final = f"{__short_version__}.{PATCH_VERSION}"
REQUIRED_PYTHON_VER: Final[tuple[int, int, int]] = (3, 10, 0)
REQUIRED_PYTHON_VER: Final[tuple[int, int, int]] = (3, 11, 0)
REQUIRED_NEXT_PYTHON_VER: Final[tuple[int, int, int]] = (3, 11, 0)
19 changes: 16 additions & 3 deletions src/pytest_homeassistant_custom_component/plugins.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@

def _utcnow() -> datetime.datetime:
"""Make utcnow patchable by freezegun."""
return datetime.datetime.now(datetime.timezone.utc)
return datetime.datetime.now(datetime.UTC)


dt_util.utcnow = _utcnow # type: ignore[assignment]
Expand Down Expand Up @@ -1108,21 +1108,34 @@ def mock_get_source_ip() -> Generator[None, None, None]:
@pytest.fixture
def mock_zeroconf() -> Generator[None, None, None]:
"""Mock zeroconf."""
with patch("homeassistant.components.zeroconf.HaZeroconf", autospec=True), patch(
from zeroconf import DNSCache # pylint: disable=import-outside-toplevel

with patch(
"homeassistant.components.zeroconf.HaZeroconf", autospec=True
) as mock_zc, patch(
"homeassistant.components.zeroconf.HaAsyncServiceBrowser", autospec=True
):
yield
zc = mock_zc.return_value
# DNSCache has strong Cython type checks, and MagicMock does not work
# so we must mock the class directly
zc.cache = DNSCache()
yield mock_zc


@pytest.fixture
def mock_async_zeroconf(mock_zeroconf: None) -> Generator[None, None, None]:
"""Mock AsyncZeroconf."""
from zeroconf import DNSCache # pylint: disable=import-outside-toplevel

with patch("homeassistant.components.zeroconf.HaAsyncZeroconf") as mock_aiozc:
zc = mock_aiozc.return_value
zc.async_unregister_service = AsyncMock()
zc.async_register_service = AsyncMock()
zc.async_update_service = AsyncMock()
zc.zeroconf.async_wait_for_start = AsyncMock()
# DNSCache has strong Cython type checks, and MagicMock does not work
# so we must mock the class directly
zc.zeroconf.cache = DNSCache()
zc.zeroconf.done = False
zc.async_close = AsyncMock()
zc.ha_async_close = AsyncMock()
Expand Down
2 changes: 1 addition & 1 deletion version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.13.45
0.13.46

0 comments on commit f394aae

Please sign in to comment.