Skip to content
Snippets Groups Projects
Unverified Commit e14146d7 authored by epenet's avatar epenet Committed by GitHub
Browse files

Fix consider-using-with pylint warnings in matrix tests (#119365)

parent 2e9f63ce
No related branches found
No related tags found
No related merge requests found
......@@ -24,6 +24,7 @@ from nio import (
)
from PIL import Image
import pytest
from typing_extensions import Generator
from homeassistant.components.matrix import (
CONF_COMMANDS,
......@@ -305,9 +306,9 @@ def command_events(hass: HomeAssistant):
@pytest.fixture
def image_path(tmp_path: Path):
def image_path(tmp_path: Path) -> Generator[tempfile._TemporaryFileWrapper]:
"""Provide the Path to a mock image."""
image = Image.new("RGBA", size=(50, 50), color=(256, 0, 0))
image_file = tempfile.NamedTemporaryFile(dir=tmp_path)
image.save(image_file, "PNG")
return image_file
with tempfile.NamedTemporaryFile(dir=tmp_path) as image_file:
image.save(image_file, "PNG")
yield image_file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment