setup_test_db: remove mysql-dependent coverage path

Signed-off-by: Kevin Morris <kevr@0cost.org>
This commit is contained in:
Kevin Morris 2021-06-19 05:20:23 -07:00
parent b7d67bf5fc
commit f89d06d092

View file

@ -50,7 +50,7 @@ def setup_test_db(*args):
db_backend = aurweb.config.get("database", "backend")
if db_backend != "sqlite":
if db_backend != "sqlite": # pragma: no cover
aurweb.db.session.execute("SET FOREIGN_KEY_CHECKS = 0")
else:
# We're using sqlite, setup tables to be deleted without violating
@ -61,7 +61,7 @@ def setup_test_db(*args):
for table in tables:
aurweb.db.session.execute(f"DELETE FROM {table}")
if db_backend != "sqlite":
if db_backend != "sqlite": # pragma: no cover
aurweb.db.session.execute("SET FOREIGN_KEY_CHECKS = 1")
# Expunge all objects from SQLAlchemy's IdentityMap.