mirror of
https://github.com/home-assistant/core.git
synced 2025-12-24 21:06:19 +00:00
Fix import-outside-toplevel pylint warnings in core tests (#119394)
This commit is contained in:
@@ -26,6 +26,7 @@ from aiohttp.test_utils import (
|
||||
)
|
||||
from aiohttp.typedefs import JSONDecoder
|
||||
from aiohttp.web import Application
|
||||
import bcrypt
|
||||
import freezegun
|
||||
import multidict
|
||||
import pytest
|
||||
@@ -70,6 +71,7 @@ from homeassistant.helpers import (
|
||||
recorder as recorder_helper,
|
||||
)
|
||||
from homeassistant.helpers.dispatcher import async_dispatcher_send
|
||||
from homeassistant.helpers.translation import _TranslationsCacheData
|
||||
from homeassistant.helpers.typing import ConfigType
|
||||
from homeassistant.setup import BASE_PLATFORMS, async_setup_component
|
||||
from homeassistant.util import location
|
||||
@@ -394,8 +396,6 @@ def reset_hass_threading_local_object() -> Generator[None]:
|
||||
@pytest.fixture(scope="session", autouse=True)
|
||||
def bcrypt_cost() -> Generator[None]:
|
||||
"""Run with reduced rounds during tests, to speed up uses."""
|
||||
import bcrypt
|
||||
|
||||
gensalt_orig = bcrypt.gensalt
|
||||
|
||||
def gensalt_mock(rounds=12, prefix=b"2b"):
|
||||
@@ -1174,8 +1174,6 @@ def mock_get_source_ip() -> Generator[_patch]:
|
||||
@pytest.fixture(autouse=True, scope="session")
|
||||
def translations_once() -> Generator[_patch]:
|
||||
"""Only load translations once per session."""
|
||||
from homeassistant.helpers.translation import _TranslationsCacheData
|
||||
|
||||
cache = _TranslationsCacheData({}, {})
|
||||
patcher = patch(
|
||||
"homeassistant.helpers.translation._TranslationsCacheData",
|
||||
|
||||
Reference in New Issue
Block a user