mirror of
https://github.com/home-assistant/core.git
synced 2025-04-25 17:57:55 +00:00
Fix Path.__enter__ DeprecationWarning in tests (#125227)
This commit is contained in:
parent
1e1c3506fe
commit
3a44098ddf
@ -54,9 +54,11 @@ def mock_process_uploaded_file(
|
|||||||
create_google_credentials_json: str,
|
create_google_credentials_json: str,
|
||||||
) -> Generator[MagicMock]:
|
) -> Generator[MagicMock]:
|
||||||
"""Mock upload certificate files."""
|
"""Mock upload certificate files."""
|
||||||
|
ctx_mock = MagicMock()
|
||||||
|
ctx_mock.__enter__.return_value = Path(create_google_credentials_json)
|
||||||
with patch(
|
with patch(
|
||||||
"homeassistant.components.google_cloud.config_flow.process_uploaded_file",
|
"homeassistant.components.google_cloud.config_flow.process_uploaded_file",
|
||||||
return_value=Path(create_google_credentials_json),
|
return_value=ctx_mock,
|
||||||
) as mock_upload:
|
) as mock_upload:
|
||||||
yield mock_upload
|
yield mock_upload
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user