Upgrade to sqlalchemy 1.4.11 (#49538)
This commit is contained in:
parent
303ab36c54
commit
c10836fcee
12 changed files with 84 additions and 74 deletions
|
@ -5,12 +5,12 @@ import sqlite3
|
|||
from unittest.mock import MagicMock, patch
|
||||
|
||||
import pytest
|
||||
from sqlalchemy import text
|
||||
|
||||
from homeassistant.components.recorder import run_information_with_session, util
|
||||
from homeassistant.components.recorder.const import DATA_INSTANCE, SQLITE_URL_PREFIX
|
||||
from homeassistant.components.recorder.models import RecorderRuns
|
||||
from homeassistant.components.recorder.util import end_incomplete_runs, session_scope
|
||||
from homeassistant.const import EVENT_HOMEASSISTANT_STOP
|
||||
from homeassistant.util import dt as dt_util
|
||||
|
||||
from .common import corrupt_db_file
|
||||
|
@ -55,7 +55,7 @@ def test_recorder_bad_commit(hass_recorder):
|
|||
|
||||
def work(session):
|
||||
"""Bad work."""
|
||||
session.execute("select * from notthere")
|
||||
session.execute(text("select * from notthere"))
|
||||
|
||||
with patch(
|
||||
"homeassistant.components.recorder.time.sleep"
|
||||
|
@ -122,7 +122,7 @@ async def test_last_run_was_recently_clean(hass):
|
|||
is False
|
||||
)
|
||||
|
||||
hass.bus.async_fire(EVENT_HOMEASSISTANT_STOP)
|
||||
await hass.async_add_executor_job(hass.data[DATA_INSTANCE]._end_session)
|
||||
await hass.async_block_till_done()
|
||||
|
||||
assert (
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue