Use tmp_path in tests (#91203)
* Use tmp_path in tests * Use joinpath * Prefer / operator * Cleanup
This commit is contained in:
parent
4e78bcb236
commit
e277bbb513
5 changed files with 69 additions and 75 deletions
|
@ -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:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue