mirror of
https://github.com/home-assistant/core.git
synced 2025-07-21 20:27:08 +00:00
Bump ruff to 0.0.253 (#89211)
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
This commit is contained in:
parent
e8bdaaacd9
commit
91e389c58d
@ -1,6 +1,6 @@
|
||||
repos:
|
||||
- repo: https://github.com/charliermarsh/ruff-pre-commit
|
||||
rev: v0.0.247
|
||||
rev: v0.0.253
|
||||
hooks:
|
||||
- id: ruff
|
||||
args:
|
||||
|
@ -188,7 +188,10 @@ class PS4Device(MediaPlayerEntity):
|
||||
self._attr_source = self._attr_media_title
|
||||
self._attr_media_content_type = None
|
||||
# Get data from PS Store.
|
||||
asyncio.ensure_future(self.async_get_title_data(title_id, name))
|
||||
self.hass.async_create_background_task(
|
||||
self.async_get_title_data(title_id, name),
|
||||
"ps4.media_player-get_title_data",
|
||||
)
|
||||
else:
|
||||
if self.state != MediaPlayerState.IDLE:
|
||||
self.idle()
|
||||
|
@ -393,7 +393,10 @@ class ZHAGateway:
|
||||
device_info = zha_device.zha_device_info
|
||||
zha_device.async_cleanup_handles()
|
||||
async_dispatcher_send(self._hass, f"{SIGNAL_REMOVE}_{str(zha_device.ieee)}")
|
||||
asyncio.ensure_future(self._async_remove_device(zha_device, entity_refs))
|
||||
self._hass.async_create_task(
|
||||
self._async_remove_device(zha_device, entity_refs),
|
||||
"ZHAGateway._async_remove_device",
|
||||
)
|
||||
if device_info is not None:
|
||||
async_dispatcher_send(
|
||||
self._hass,
|
||||
|
@ -14,5 +14,5 @@ pycodestyle==2.10.0
|
||||
pydocstyle==6.2.3
|
||||
pyflakes==3.0.1
|
||||
pyupgrade==3.3.1
|
||||
ruff==0.0.247
|
||||
ruff==0.0.253
|
||||
yamllint==1.28.0
|
||||
|
@ -84,11 +84,9 @@ def test_run_does_not_block_forever_with_shielded_task(
|
||||
"""Test we can shutdown and not block forever."""
|
||||
test_dir = tmpdir.mkdir("config")
|
||||
default_config = runner.RuntimeConfig(test_dir)
|
||||
created_tasks = False
|
||||
tasks = []
|
||||
|
||||
async def _async_create_tasks(*_):
|
||||
nonlocal created_tasks
|
||||
|
||||
async def async_raise(*_):
|
||||
try:
|
||||
await asyncio.sleep(2)
|
||||
@ -101,11 +99,10 @@ def test_run_does_not_block_forever_with_shielded_task(
|
||||
except asyncio.CancelledError:
|
||||
await asyncio.sleep(2)
|
||||
|
||||
asyncio.ensure_future(asyncio.shield(async_shielded()))
|
||||
asyncio.ensure_future(asyncio.sleep(2))
|
||||
asyncio.ensure_future(async_raise())
|
||||
tasks.append(asyncio.ensure_future(asyncio.shield(async_shielded())))
|
||||
tasks.append(asyncio.ensure_future(asyncio.sleep(2)))
|
||||
tasks.append(asyncio.ensure_future(async_raise()))
|
||||
await asyncio.sleep(0.1)
|
||||
created_tasks = True
|
||||
return 0
|
||||
|
||||
with patch.object(runner, "TASK_CANCELATION_TIMEOUT", 1), patch(
|
||||
@ -115,7 +112,7 @@ def test_run_does_not_block_forever_with_shielded_task(
|
||||
):
|
||||
runner.run(default_config)
|
||||
|
||||
assert created_tasks is True
|
||||
assert len(tasks) == 3
|
||||
assert (
|
||||
"Task could not be canceled and was still running after shutdown" in caplog.text
|
||||
)
|
||||
|
Loading…
x
Reference in New Issue
Block a user