Skip to content

Commit

Permalink
Ignore asyncpg driver for test database engine
Browse files Browse the repository at this point in the history
  • Loading branch information
mhadam committed Sep 24, 2021
1 parent cba7e57 commit 1bff5c9
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tests/test_databases.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@ def create_test_database():
url = str(database_url.replace(driver="pymysql"))
elif database_url.scheme == "postgresql+aiopg":
url = str(database_url.replace(driver=None))
elif database_url.scheme == "postgresql+asyncpg":
url = str(database_url.replace(driver=None))
engine = sqlalchemy.create_engine(url)
metadata.create_all(engine)

Expand All @@ -100,6 +102,8 @@ def create_test_database():
url = str(database_url.replace(driver="pymysql"))
elif database_url.scheme == "postgresql+aiopg":
url = str(database_url.replace(driver=None))
elif database_url.scheme == "postgresql+asyncpg":
url = str(database_url.replace(driver=None))
engine = sqlalchemy.create_engine(url)
metadata.drop_all(engine)

Expand Down

0 comments on commit 1bff5c9

Please sign in to comment.