Use tmp_path in recorder tests (#91202)
This commit is contained in:
parent
a7093d3687
commit
2f7c5a56eb
5 changed files with 53 additions and 37 deletions
|
@ -6,7 +6,6 @@ from pathlib import Path
|
|||
import sqlite3
|
||||
from unittest.mock import MagicMock, Mock, patch
|
||||
|
||||
import py
|
||||
import pytest
|
||||
from sqlalchemy import text
|
||||
from sqlalchemy.engine.result import ChunkedIteratorResult
|
||||
|
@ -73,11 +72,11 @@ def test_recorder_bad_execute(hass_recorder: Callable[..., HomeAssistant]) -> No
|
|||
|
||||
|
||||
def test_validate_or_move_away_sqlite_database(
|
||||
hass: HomeAssistant, tmpdir: py.path.local, caplog: pytest.LogCaptureFixture
|
||||
hass: HomeAssistant, tmp_path: Path, caplog: pytest.LogCaptureFixture
|
||||
) -> None:
|
||||
"""Ensure a malformed sqlite database is moved away."""
|
||||
|
||||
test_dir = tmpdir.mkdir("test_validate_or_move_away_sqlite_database")
|
||||
test_dir = tmp_path.joinpath("test_validate_or_move_away_sqlite_database")
|
||||
test_dir.mkdir()
|
||||
test_db_file = f"{test_dir}/broken.db"
|
||||
dburl = f"{SQLITE_URL_PREFIX}{test_db_file}"
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue