mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
fix(fastapi): catch ProgrammingError instead of OperationalError in conftest
Signed-off-by: Kevin Morris <kevr@0cost.org>
This commit is contained in:
parent
008a8824ce
commit
0b5d088016
1 changed files with 2 additions and 2 deletions
|
@ -43,7 +43,7 @@ from filelock import FileLock
|
|||
from sqlalchemy import create_engine
|
||||
from sqlalchemy.engine import URL
|
||||
from sqlalchemy.engine.base import Engine
|
||||
from sqlalchemy.exc import OperationalError
|
||||
from sqlalchemy.exc import ProgrammingError
|
||||
from sqlalchemy.orm import scoped_session
|
||||
|
||||
import aurweb.config
|
||||
|
@ -101,7 +101,7 @@ def _create_database(engine: Engine, dbname: str) -> None:
|
|||
conn = engine.connect()
|
||||
try:
|
||||
conn.execute(f"CREATE DATABASE {dbname}")
|
||||
except OperationalError: # pragma: no cover
|
||||
except ProgrammingError: # pragma: no cover
|
||||
pass
|
||||
conn.close()
|
||||
initdb.run(AlembicArgs)
|
||||
|
|
Loading…
Add table
Reference in a new issue