mirror of
https://github.com/home-assistant/core.git
synced 2025-07-21 20:27:08 +00:00
Fix consider-using-with pylint warnings in matrix tests (#119365)
This commit is contained in:
parent
2e9f63ced6
commit
e14146d7c9
@ -24,6 +24,7 @@ from nio import (
|
|||||||
)
|
)
|
||||||
from PIL import Image
|
from PIL import Image
|
||||||
import pytest
|
import pytest
|
||||||
|
from typing_extensions import Generator
|
||||||
|
|
||||||
from homeassistant.components.matrix import (
|
from homeassistant.components.matrix import (
|
||||||
CONF_COMMANDS,
|
CONF_COMMANDS,
|
||||||
@ -305,9 +306,9 @@ def command_events(hass: HomeAssistant):
|
|||||||
|
|
||||||
|
|
||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
def image_path(tmp_path: Path):
|
def image_path(tmp_path: Path) -> Generator[tempfile._TemporaryFileWrapper]:
|
||||||
"""Provide the Path to a mock image."""
|
"""Provide the Path to a mock image."""
|
||||||
image = Image.new("RGBA", size=(50, 50), color=(256, 0, 0))
|
image = Image.new("RGBA", size=(50, 50), color=(256, 0, 0))
|
||||||
image_file = tempfile.NamedTemporaryFile(dir=tmp_path)
|
with tempfile.NamedTemporaryFile(dir=tmp_path) as image_file:
|
||||||
image.save(image_file, "PNG")
|
image.save(image_file, "PNG")
|
||||||
return image_file
|
yield image_file
|
||||||
|
Loading…
x
Reference in New Issue
Block a user