Skip to content

Commit

Permalink
Bump version
Browse files Browse the repository at this point in the history
  • Loading branch information
MatthewFlamm committed Oct 26, 2023
1 parent 6a3631f commit d40a8cb
Show file tree
Hide file tree
Showing 8 changed files with 34 additions and 41 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.10.5&labelColor=blue)
![HA core version](https://img.shields.io/static/v1?label=HA+core+version&message=2023.11.0b0&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.10.5
2023.11.0b0
8 changes: 4 additions & 4 deletions requirements_dev.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# This file is originally from homeassistant/core and modified by pytest-homeassistant-custom-component.
astroid==2.15.7
mypy==1.5.1
pre-commit==3.4.0
pylint==2.17.6
astroid==3.0.1
mypy==1.6.1
pre-commit==3.5.0
pylint==3.0.2
types-aiofiles==23.2.0.0
types-atomicwrites==1.4.5.1
types-croniter==1.0.6
Expand Down
8 changes: 4 additions & 4 deletions requirements_test.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

-c homeassistant/package_constraints.txt
-r requirements_test_pre_commit.txt
coverage==7.3.1
coverage==7.3.2
freezegun==1.2.2
mock-open==1.4.0
pydantic==1.10.12
Expand All @@ -25,13 +25,13 @@ pytest-timeout==2.1.0
pytest-unordered==0.5.2
pytest-picked==0.4.6
pytest-xdist==3.3.1
pytest==7.3.1
pytest==7.4.3
requests-mock==1.11.0
respx==0.20.2
syrupy==4.5.0
tqdm==4.66.1
homeassistant==2023.10.5
SQLAlchemy==2.0.21
homeassistant==2023.11.0b0
SQLAlchemy==2.0.22

paho-mqtt==1.6.1

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import sys
import time
from typing import Any, Literal, cast
from unittest.mock import patch, sentinel
from unittest.mock import MagicMock, patch, sentinel

from freezegun import freeze_time
from sqlalchemy import create_engine
Expand Down Expand Up @@ -434,3 +434,16 @@ def old_db_schema(schema_version_postfix: str) -> Iterator[None]:
),
):
yield


async def async_attach_db_engine(hass: HomeAssistant) -> None:
"""Attach a database engine to the recorder."""
instance = recorder.get_instance(hass)

def _mock_setup_recorder_connection():
with instance.engine.connect() as connection:
instance._setup_recorder_connection(
connection._dbapi_connection, MagicMock()
)

await instance.async_add_executor_job(_mock_setup_recorder_connection)
4 changes: 2 additions & 2 deletions src/pytest_homeassistant_custom_component/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@

APPLICATION_NAME: Final = "HomeAssistant"
MAJOR_VERSION: Final = 2023
MINOR_VERSION: Final = 10
PATCH_VERSION: Final = "5"
MINOR_VERSION: Final = 11
PATCH_VERSION: Final = "0b0"
__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)
Expand Down
34 changes: 7 additions & 27 deletions src/pytest_homeassistant_custom_component/plugins.py
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,13 @@ def verify_cleanup(
)


@pytest.fixture(autouse=True)
def reset_hass_threading_local_object() -> Generator[None, None, None]:
"""Reset the _Hass threading.local object for every test case."""
yield
ha._hass.__dict__.clear()


@pytest.fixture(autouse=True)
def bcrypt_cost() -> Generator[None, None, None]:
"""Run with reduced rounds during tests, to speed up uses."""
Expand Down Expand Up @@ -1519,33 +1526,6 @@ async def recorder_mock(
return await async_setup_recorder_instance(hass, recorder_config)


@pytest.fixture
def mock_integration_frame() -> Generator[Mock, None, None]:
"""Mock as if we're calling code from inside an integration."""
correct_frame = Mock(
filename="/home/paulus/homeassistant/components/hue/light.py",
lineno="23",
line="self.light.is_on",
)
with patch(
"homeassistant.helpers.frame.extract_stack",
return_value=[
Mock(
filename="/home/paulus/homeassistant/core.py",
lineno="23",
line="do_something()",
),
correct_frame,
Mock(
filename="/home/paulus/aiohue/lights.py",
lineno="2",
line="something()",
),
],
):
yield correct_frame


@pytest.fixture(name="enable_bluetooth")
async def mock_enable_bluetooth(
hass: HomeAssistant,
Expand Down
2 changes: 1 addition & 1 deletion version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.13.68
0.13.69

0 comments on commit d40a8cb

Please sign in to comment.