1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-24 12:59:34 +00:00

Add CI job which runs recorder tests on PostgreSQL (#80614)

Co-authored-by: Franck Nijhof <git@frenck.dev>
Co-authored-by: J. Nick Koston <nick@koston.org>
This commit is contained in:
Erik Montnemery
2023-02-07 16:46:14 +01:00
committed by GitHub
parent 3a83b2f66f
commit 720f51657d
10 changed files with 187 additions and 41 deletions

View File

@@ -1002,9 +1002,12 @@ def recorder_db_url(pytestconfig):
assert not sqlalchemy_utils.database_exists(db_url)
sqlalchemy_utils.create_database(db_url, encoding=charset)
elif db_url.startswith("postgresql://"):
pass
import sqlalchemy_utils
assert not sqlalchemy_utils.database_exists(db_url)
sqlalchemy_utils.create_database(db_url, encoding="utf8")
yield db_url
if db_url.startswith("mysql://"):
if db_url.startswith("mysql://") or db_url.startswith("postgresql://"):
sqlalchemy_utils.drop_database(db_url)