1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-25 05:26:47 +00:00

Enable Ruff PT022 (#86792)

* Enable Ruff PT022

* Adjust found cases
This commit is contained in:
Franck Nijhof
2023-01-27 13:57:06 +01:00
committed by GitHub
parent 8c993116e1
commit ef800335fb
50 changed files with 79 additions and 88 deletions

View File

@@ -154,7 +154,7 @@ def default_request_fixture(respx_mock):
)
respx.post(f"{path}/local/vmd/control.cgi").respond(json=VMD4_RESPONSE)
yield __mock_default_requests
return __mock_default_requests
@pytest.fixture
@@ -187,7 +187,7 @@ async def prep_config_entry_fixture(hass, config_entry, setup_default_vapix_requ
await hass.async_block_till_done()
return config_entry
yield __mock_setup_config_entry
return __mock_setup_config_entry
@pytest.fixture(name="setup_config_entry")
@@ -195,7 +195,7 @@ async def setup_config_entry_fixture(hass, config_entry, setup_default_vapix_req
"""Define a fixture to set up Axis network device."""
assert await hass.config_entries.async_setup(config_entry.entry_id)
await hass.async_block_till_done()
yield config_entry
return config_entry
# RTSP fixtures
@@ -283,7 +283,7 @@ def mock_rtsp_event(mock_axis_rtspclient):
mock_axis_rtspclient(data=event.encode("utf-8"))
yield send_event
return send_event
@pytest.fixture(autouse=True)
@@ -295,4 +295,4 @@ def mock_rtsp_signal_state(mock_axis_rtspclient):
signal = Signal.PLAYING if connected else Signal.FAILED
mock_axis_rtspclient(state=signal)
yield send_signal
return send_signal