Use loader.async_suggest_report_issue in frame helper (#101461)
This commit is contained in:
parent
cb0a05142d
commit
dce5099d92
4 changed files with 41 additions and 30 deletions
|
@ -132,7 +132,7 @@ async def test_extract_frame_no_integration(caplog: pytest.LogCaptureFixture) ->
|
|||
|
||||
@patch.object(frame, "_REPORTED_INTEGRATIONS", set())
|
||||
async def test_prevent_flooding(
|
||||
caplog: pytest.LogCaptureFixture, mock_integration_frame: Mock
|
||||
hass: HomeAssistant, caplog: pytest.LogCaptureFixture, mock_integration_frame: Mock
|
||||
) -> None:
|
||||
"""Test to ensure a report is only written once to the log."""
|
||||
|
||||
|
@ -142,9 +142,10 @@ async def test_prevent_flooding(
|
|||
filename = "homeassistant/components/hue/light.py"
|
||||
|
||||
expected_message = (
|
||||
f"Detected integration that {what}. Please report issue for {integration} using"
|
||||
f" this method at {filename}, line "
|
||||
f"{mock_integration_frame.lineno}: {mock_integration_frame.line}"
|
||||
f"Detected that integration '{integration}' {what} at {filename}, line "
|
||||
f"{mock_integration_frame.lineno}: {mock_integration_frame.line}, "
|
||||
f"please create a bug report at https://github.com/home-assistant/core/issues?"
|
||||
f"q=is%3Aopen+is%3Aissue+label%3A%22integration%3A+{integration}%22"
|
||||
)
|
||||
|
||||
frame.report(what, error_if_core=False)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue