Use tmp_path in tests (#91203)

* Use tmp_path in tests

* Use joinpath

* Prefer / operator

* Cleanup
This commit is contained in:
epenet 2023-04-12 08:19:01 +02:00 committed by GitHub
parent 4e78bcb236
commit e277bbb513
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 69 additions and 75 deletions

View file

@ -3,6 +3,7 @@ import asyncio
from datetime import timedelta
from io import BytesIO
import os
from pathlib import Path
from unittest.mock import patch
import av
@ -39,9 +40,9 @@ async def stream_component(hass):
@pytest.fixture
def filename(tmpdir):
def filename(tmp_path: Path) -> str:
"""Use this filename for the tests."""
return f"{tmpdir}/test.mp4"
return str(tmp_path / "test.mp4")
async def test_record_stream(hass: HomeAssistant, filename, h264_video) -> None: