Remove log flooding prevention logic from discovery info (#61243)
Co-authored-by: epenet <epenet@users.noreply.github.com>
This commit is contained in:
parent
9c11bb8ba1
commit
c05eca1c82
12 changed files with 163 additions and 159 deletions
|
@ -6,7 +6,7 @@ import logging
|
|||
import socket
|
||||
import ssl
|
||||
import threading
|
||||
from unittest.mock import AsyncMock, MagicMock, patch
|
||||
from unittest.mock import AsyncMock, MagicMock, Mock, patch
|
||||
|
||||
from aiohttp.test_utils import make_mocked_request
|
||||
import freezegun
|
||||
|
@ -778,3 +778,30 @@ def hass_recorder(enable_statistics, hass_storage):
|
|||
|
||||
yield setup_recorder
|
||||
hass.stop()
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def mock_integration_frame():
|
||||
"""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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue