mirror of
https://github.com/home-assistant/core.git
synced 2025-04-23 16:57:53 +00:00
Fix blocking I/O in event loop in google_assistant test (#121126)
found by ruff in #120799
This commit is contained in:
parent
595e688c56
commit
84d8bc711d
@ -4,6 +4,7 @@ from datetime import UTC, datetime, timedelta
|
||||
from http import HTTPStatus
|
||||
import json
|
||||
import os
|
||||
from pathlib import Path
|
||||
from typing import Any
|
||||
from unittest.mock import ANY, patch
|
||||
from uuid import uuid4
|
||||
@ -655,9 +656,7 @@ async def test_async_get_users(
|
||||
)
|
||||
path = hass.config.config_dir / ".storage" / GoogleConfigStore._STORAGE_KEY
|
||||
os.makedirs(os.path.dirname(path), exist_ok=True)
|
||||
with open(path, "w", encoding="utf8") as f:
|
||||
f.write(store_data)
|
||||
|
||||
await hass.async_add_executor_job(Path(path).write_text, store_data)
|
||||
assert await async_get_users(hass) == expected_users
|
||||
|
||||
await hass.async_stop()
|
||||
|
Loading…
x
Reference in New Issue
Block a user